note 32412 added to function.number-format
| From: | javi_eu at yahoo dot com | Date: | Tue, 27 May 2003 09:31:27 +0000 |
| Subject: | note 32412 added to function.number-format | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-49075@lists.php.net to get a copy of this message | ||
I think there's an error in calculating the round value of float variables. If you try to round
1.935 to 2-precission:
echo number_format(1.935,2,",",".");
That returns 1.94, that's OK owing to the existence of the convencionalism that the last 5 goes
up...
But if you try to round 739.935 (it should be 739.94, shouldn't it?):
echo number_format(739.935,2,",",".");
It returns 739.93!!! There is no coherency!
Does somebody know a solution for this problem? Thanks a lot in advance...
----
Manual Page -- http://www.php.net/manual/en/function.number-format.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32412
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32412&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32412&report=yes