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);
![]() | is_float描述bool is_float ( mixed var )如果 var 是 float 则返回 TRUE,否则返回 FALSE。
参见 is_bool()、is_int()、is_integer()、is_numeric()、is_string()、is_array() 和 is_object()。 ![]()
phper
26-Jan-2006 04:08
A better way to check for a certain number of decimal places is to use :
kirti dot contact at gmail dot com
19-Oct-2005 02:18
To check a float only should contain certain number of decimal places, I have used this simple function below | ![]() |