PDA

View Full Version : Rounding up figures in PHP


cocoonfx
10-16-2007, 04:47 AM
Hello


I have built some calculations as a part of a members area but there showing to 2 decimal places. i.e 145.80

Is it possible to get PHP to round up or down i.e the above would be 146

Any suggestions would be appreciated

davidj
10-16-2007, 05:46 AM
use the round function

$roundup = round(145.80); // << output 146