note 32743 rejected from function.number-format by alindeman
| From: | alindeman@php.net | Date: | Thu, 05 Jun 2003 18:56:49 +0000 |
| Subject: | note 32743 rejected from function.number-format by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49807@lists.php.net to get a copy of this message | ||
Note Submitter: service@tucsonmobiletechs.com
----
I do see that number_format rounds....
your example of
$val1 = 1.233;
$val2 = 1.235;
$val3 = 1.237;
echo number_format(al1,2,",",".") . "<BR>"; // returns: 1,23
echo number_format($val2,2,",",".") . "<BR>"; // returns: 1,24
echo number_format($val3,2,",",".") . "<BR>"; // returns: 1,24
does as you specify, however, try inserting $val2 = 1.555 and you end up with 1.55.....is this not
rounding correctly?