⬅︎ Back to isInt() JavaScript function
This fails on floating point numbers. isInt("1.1") is false but isInt("1.0") is true which it's not supposed to.
I tend to use: function isInt (i) { return (i % 1) == 0; }
Comment
This fails on floating point numbers. isInt("1.1") is false but isInt("1.0") is true which it's not supposed to.
Parent comment
I tend to use: function isInt (i) { return (i % 1) == 0; }