aboutsummaryrefslogblamecommitdiffstats
path: root/library/moment/src/lib/utils/to-int.js
blob: fb489416f160e9bb118e134c8c835fafeedde143 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                         
import absFloor from './abs-floor';

export default function toInt(argumentForCoercion) {
    var coercedNumber = +argumentForCoercion,
        value = 0;

    if (coercedNumber !== 0 && isFinite(coercedNumber)) {
        value = absFloor(coercedNumber);
    }

    return value;
}