note 32412 rejected from function.number-format by derick

From: Date: Tue, 27 May 2003 09:32:03 +0000
Subject: note 32412 rejected from function.number-format by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-49076@lists.php.net to get a copy of this message
Note Submitter: javi_eu@yahoo.com ---- 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...

« previous php.notes (#49076) next »