#33107 [NEW]: example code is incorrect

From: Date: Mon, 23 May 2005 09:02:38 +0000
Subject: #33107 [NEW]: example code is incorrect
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969368323@lists.php.net to get a copy of this message
From: jmarbas at hotmail dot com Operating system: XP PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: example code is incorrect Description: ------------ On page http://ca.php.net/manual/en/function.number-format.php the example code is incorrect because the number 1234.56 is rounded up to 1235 when you pass number_format only one parameter. For example the code below will output 1235. $number = 1234.56; //english notation(default) echo number_format($number)."<br />"; echo "should be 1,234 as per the example code on page"; You should modify the example code on that page to reflect reality. Reproduce code: --------------- $number = 1234.56; //english notation(default) echo number_format($number)."<br />"; echo "should be 1,234 as per the example code on page"; Expected result: ---------------- 1235 -- Edit bug report at http://bugs.php.net/?id=33107&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33107&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33107&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33107&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33107&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33107&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33107&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33107&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33107&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33107&r=support Expected behavior: http://bugs.php.net/fix.php?id=33107&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33107&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33107&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33107&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33107&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33107&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33107&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33107&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33107&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33107&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33107&r=mysqlcfg

« previous php.doc (#969368323) next »