Forum Moderators: coopster
Basically I want to round up all the figures in the $Price field from the mysql database.
I've played around with the php round function but to no avail!
Any help would be appreciated.
Many thanks
$number = 6.989; $newNumber = number_format($number,2);
That will cut $number to 2 decimal places, rounding it accordingly.
$number = 6.981;$newNumber = [url=http://php.net/number_format]number_format[/url]( ( ( [url=http://php.net/ceil]ceil[/url]($number * 100) ) / 100 ) , 2);echo $newNumber; // 6.99
Thanks again!
Thanks to both of you!
Cheers!
$value = 3.392 $num = round($value +.5);