Node.js examples for Number:Int
Convert a value to an integer
Object.prototype.toInt = function() { var str = String(this); str = str.replace(/[^0-9-.]/g, ""); var ret = parseInt(str, 10); if (isNaN(ret)) ret = 0; return ret;//from w ww .j a v a 2 s . c om }