round behavior changed
| From: | Sébastien Guay | Date: | Fri, 19 May 2006 18:27:23 +0000 |
| Subject: | round behavior changed | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-236512@lists.php.net to get a copy of this message | ||
Hi,
I searched the archives but did not found anything.
It seem that the round function behavior has changed in php 4.4.x (I don't
have 4.4.1 handy for testing).
In 4.3.11, the output of round("23.005",2) is 23.01 which is mathematically
correct.
In 4.4.2, the output is 23 which is not correct. The output of
round("23.0051",2) is correct though (23.01).
Is there a workaround/patch for this?
Thanks in advance
Sébas