PHP rounding error
I'm using PHP 5.2.13 on my linux server. I'm getting weird error when rounding numbers. This is my test case: <?php echo " " . round(1.505, 2) . "\n"; echo " " . round(11.505, 2) . "\n"; echo " " . round(111.505, 2) . "\n"; echo " " . round(1111.505, 2) . "\n"; echo " " . round(11111.505, 2) . "\n"; echo " " . round(111111.505, 2) . "\n"; echo " " . round(1111111.505, 2) . "\n"; echo " " . round(11111111.505, 2) . "\n"; echo "" . round(111111111.505, 2) . "\n"; This is results: 1.51 11.51 111.51 1111.51 11111.51 111111.51 1111111.5 11111111.51 111111111.51 Anyone knows what causes this? I can