Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if number is float

x = 1;     x===parseInt(x); // true
x = "1";   x===parseInt(x); // false
x = 1.1;   x===parseInt(x); // false, obviously

// BUT!
x = 1.0;   x===parseInt(x); // true, because 1.0 is NOT a float!
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #number #float
ADD COMMENT
Topic
Name
6+7 =