How to find that a number is float or integer?
float
integer
1.25 --> float 1 --> integer 0 --> integer 0.25 --> float <
1.25 --> float 1 --> integer 0 --> integer 0.25 --> float
Here's what I use for integers:
Math.ceil(parseFloat(val)) === val
Short, nice :) Works all the time. This is what David Flanagan suggests if I'm not mistaken.