Rounding number question? PLEASE HELP!
Posted: Wed Sep 17, 2008 1:26 pm
Hi,
I try to do the rounding as follow, some of numbers is working but some are not.
Original value : 5299792.155 and it show 5.3 after the following statement, but what I want is show as 5300 round up to 1000's
$rounded = substr(round($value['SUM(sales)'], -3), 0, -3); if ($rounded == 0) { echo "0"; } else { echo $rounded; }
Any idea
Thanks!
I try to do the rounding as follow, some of numbers is working but some are not.
Original value : 5299792.155 and it show 5.3 after the following statement, but what I want is show as 5300 round up to 1000's
$rounded = substr(round($value['SUM(sales)'], -3), 0, -3); if ($rounded == 0) { echo "0"; } else { echo $rounded; }
Any idea
Thanks!