ID: 16946 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] 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] [EMAIL PROTECTED] 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] [EMAIL PROTECTED] 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