Plato on Github
Report Home
node_modules/es5-ext/number/to-integer.js
Maintainability
68.79
Lines of code
12
Difficulty
11.00
Estimated Errors
0.09
Function weight
By Complexity
By SLOC
'use strict'; var sign = require('../math/sign') , abs = Math.abs, floor = Math.floor; module.exports = function (value) { if (isNaN(value)) return 0; value = Number(value); if ((value === 0) || !isFinite(value)) return value; return sign(value) * floor(abs(value)); };