T
Tharma
Hi
I wanted to extract the decimal portion from a number. I tried the following
code but I didn't get the exact decimal portion.
If anyone know how to extract please let me know.
$num = 1234.56;
$decimal = ($num - int($num));
print $decimal;
Here I get 0.559999999999945 instead of 0.56. Why and How can I correct it?.
I wanted to extract the decimal portion from a number. I tried the following
code but I didn't get the exact decimal portion.
If anyone know how to extract please let me know.
$num = 1234.56;
$decimal = ($num - int($num));
print $decimal;
Here I get 0.559999999999945 instead of 0.56. Why and How can I correct it?.