#49764 [Opn->Fbk]: number_format()

From: Date: Sun, 04 Oct 2009 18:03:36 +0000
Subject: #49764 [Opn->Fbk]: number_format()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-143239@lists.php.net to get a copy of this message
 ID:               49764
 Updated by:       jani@php.net
-Summary:          number_format
 Reported By:      tec at baufi24 dot de
-Status:           Open
+Status:           Feedback
 Bug Type:         Math related
 Operating System: Windows Server 2003 RC2
 PHP Version:      5.2.11
 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




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

[2009-10-04 08:55:27] tec at baufi24 dot de

Description:
------------
Using number_format will sometimes produce a very hard error. This
phenomenon is not persistent. Sometimes i will see that, but i dont know
what conditions are necessary to reproduce

Reproduce code:
---------------
$value = 2900;
echo "Unformated: ".$value."<br />";
echo "Using number_format: ".number_format($value, 2, ',',
'.')."<br
/>";
echo "Crosscheck: ".number_format(2900, 2, ',', '.')."<br
/>";

Expected result:
----------------
Unformated: 2900
Using number_format: 2.900,00
Crosscheck: 2.900,00

Actual result:
--------------
Unformated: 2900
Using number_format: 2.8:0,00
Crosscheck: 2.8:0,00


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49764&edit=1



Thread (14 messages)

« previous php.bugs (#143239) next »