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
For integers I use this
function integer_or_null(value) { if ((undefined === value) || (null === value)) { return null; } if(value % 1 != 0) { return null; } return value; }