Bug #16946 Updated: number_format documentation example problem
| From: | hpdl at oscommerce dot com | Date: | Tue, 07 May 2002 14:30:25 +0000 |
| Subject: | Bug #16946 Updated: number_format documentation example problem | ||
| References: | 1 | Groups: | php.bugs php.doc |
| Request: | Send a blank email to php-bugs+get-7147@lists.php.net to get a copy of this message | ||
ID: 16946
Updated by: hpdl@oscommerce.com
Reported By: hpdl@oscommerce.com
Status: Closed
Bug Type: Documentation problem
Operating System: documentation
PHP Version: 4.1.2
New Comment:
could the rounding feature of number_format be documented?
also the empty/no thousands separator does not seem to work with php3
(as mentioned in the comments) - perhaps this should be documented as a
php4 only feature too?
thanks for your time
Previous Comments:
------------------------------------------------------------------------
[2002-05-02 06:48:22] sander@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/
------------------------------------------------------------------------
[2002-05-01 10:26:47] hpdl@oscommerce.com
The example listed on the number_format page is not taking into account
the rounding of the value returned.
http://www.php.net/manual/en/function.number-format.php
<?php
$number = 1234.56;
// english notation (default)
$english_format_number = number_format($number);
// 1,234.56
// French notation
$nombre_format_francais = number_format($number, 2, ',', ' ');
// 1 234,56
$number = 1234.5678;
// english notation without thousands seperator
$english_format_number = number_format($number, 2, '.', '');
// 1234.56
?>
The last output should be 1234.57
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16946&edit=1