php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #33107 example code is incorrect
Submitted: 2005-05-23 11:02 UTC Modified: 2005-05-23 12:55 UTC
From: jmarbas at hotmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: XP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jmarbas at hotmail dot com
New email:
PHP Version: OS:

 

 [2005-05-23 11:02 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-23 12:55 UTC] vrana@php.net
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.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 13:01:36 2025 UTC