List of utility methods to do Int Value Check
isInt()String.prototype.isInt = function() { if (this == "NaN") return false; return this == parseInt(this).toString(); | |
isInteger()String.prototype.isInteger = function() { return (/\d/g).test(this); | |
isInteger()String.prototype.isInteger = function() return (/^[-\+]?\d+$/.test(this.Trim())); | |
isInteger(value, isString)Number.isInteger = function isInteger(value, isString) { if (typeof value === "string" && isString) { if (value.match(/^[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?$/)) { return Number.isInteger(parseFloat(value, 10)); return typeof value === "number" && isFinite(value) && Math.floor(value) === value; }; |