For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > May 2005 > #33107 [Opn->Csd]: example code is incorrect









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #33107 [Opn->Csd]: example code is incorrect
vrana@php.net

2005-05-26, 8:57 pm

ID: 33107
Updated by: vrana@php.net
Reported By: jmarbas at hotmail dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: XP
PHP Version: Irrelevant
New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.


Previous Comments:
------------------------------------------------------------------------

[2005-05-23 11:02:37] jmarbas at hotmail dot com

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 this bug report at http://bugs.php.net/?id=33107&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com