Hi everyone, Got another math calculation problem again.
$a = 34.56
$b = 34.55
$a do some calculation to get this figure
$b is doing rounding nearest 0.05 to get this figure
what happen is
$c = $b - $a
supposedly I should be -0.01, but I echo out the $c is show -0.00988888888888
I try to use number_format($c, 2), but the output is 0.00,
how can I make sure $a and $b is exactly 2 decimals, no hidden number at the back.
in my php knowledge number_format only able to format the display, but the value not really 2 decimal,
I hope I can get help from here. This really frustrated me.