how not to round your floats…
19-Jul-2010
Just so I never foget… observe the following test cases – $foo = 8.37*40*0.175*100; echo $foo.' == '.(int)$foo; > 5859 == 5858 $foo = 8.37*40*0.175*100; echo $foo.' == '.round($foo); > 5859 == 5859 I believe that casing to INT will round towards zero as documented in the php docs, I also believe the 5858 number [...]









