I am passing in a parameter called value. I\'d like to know if value is a float. So far, I have the following:
if (!isNaN(value))
{
alert(\'this is a num
Number.prototype.isFloat = function() {
return (this % 1 != 0);
}
Then you can
var floatValue = parseFloat("2.13");
var nonFloatValue = parseFloat("11");
console.log(floatValue.isFloat()); // will output true
console.log(nonFloatValue.isFloat()); // will output false
Values like 2.00 cannot really be considered float in JS, or rather every number is a float in JS.