(PHP 3, PHP 4, PHP 5)
Finds whether the given variable is a float.
Замечание: To test if a variable is a number or a numeric string (such as form input, which is always a string), you must use is_numeric().
The variable being evaluated.
Returns TRUE if var is a float, FALSE otherwise.
A better way to check for a certain number of decimal places is to use : $num_dec_places = 2; number_format($value,$num_dec_places);
To check a float only should contain certain number of decimal places, I have used this simple function below <? function is_deccount($number,$decimal=2){ $m_factor=pow(10,$decimal); if((int)($number*$m_factor)==$number*$m_factor) return true; else return false; } ?>