#23435 [NEW]: number_format works badly
| From: | marcin at gasnace dot slonca dot net | Date: | Thu, 01 May 2003 09:37:36 +0000 |
| Subject: | #23435 [NEW]: number_format works badly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-38875@lists.php.net to get a copy of this message | ||
From: marcin at gasnace dot slonca dot net
Operating system: Slackware Linux 8.1 kernel2.4.20
PHP version: 4.3.1
PHP Bug Type: *Math Functions
Bug description: number_format works badly
i've got a script:
<?
echo number_format("4.705",2,'.','');
echo "<br>";
echo number_format("1.785",2,'.','');
?>
the result should be:
4.71
1.79 (because last digit is 5)
but is
4.71
1.78 <-- why?
--
Edit bug report at http://bugs.php.net/?id=23435&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23435&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23435&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23435&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23435&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23435&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23435&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23435&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23435&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23435&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23435&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23435&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23435&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23435&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23435&r=gnused