some times there are problems with displaying decimal numbers in PHP.
One I encountered was when I was displaying a number to 2 decimal places after multiplying by 10.
This causes it to become a float again and does not do what it should with number_format and sprint printf and round!
nothing will work except this….
1 2 3 4 5 6 7 8 9 10 |
$tenmonths = 29.877643; // below does not work <?php echo round($tenmonths*10, 2) ?> //above does not work //THIS WORKS <?php echo bcmul($tenmonths, 10, 2) ?> |