Page 1 of 1

round() doesn't work

Posted: Fri Feb 26, 2010 5:58 am
by klevis miho
Why doesn't this line of code works:

echo round(8.5, 0, PHP_ROUND_HALF_UP);

It displays me this error:
Wrong parameter count for round()

It's so strange because I copy and pasted it from the php manual http://php.net/manual/en/function.round.php

Re: round() doesn't work

Posted: Fri Feb 26, 2010 6:05 am
by Darhazer
The third parameter is introduced in PHP 5.3.0
In PHP 5.2, there are only 2 parameters available

Re: round() doesn't work

Posted: Fri Feb 26, 2010 6:07 am
by klevis miho
Thnx man :)