Problem with number_format
| From: | fku at freemail dot it | Date: | Tue, 25 May 2004 14:00:49 +0000 |
| Subject: | Problem with number_format | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-186889@lists.php.net to get a copy of this message | ||
Hi,
please suppose PHP 4.3.2 and $number=502,3550
number_format($number,2,'.',' ') returns 502.36.
It seems ok, but if $number=253,0650
number_format($number,2,'.',' ') returns 253.06 instead of 253.07.
Why?
I've noticed this non-coherent approximation behaviour when
3rd decimal number is 5 and decimals are two many many
times.
It's a my error or should be a bug?
Thanks, ciao
Francesco
-----------------------------------------------------------
Spazio ILLIMITATO per la tua Email, Scanner Antivirus,
Antispam, Backup e POP3. Prova la nuova Email di superEva:
http://webmail.supereva.it/
-----------------------------------------------------------