Bug #53791 [Opn->Fbk]: NumberFormat::parse fail with French thousands separator

From: Date: Wed, 19 Jan 2011 15:55:20 +0000
Subject: Bug #53791 [Opn->Fbk]: NumberFormat::parse fail with French thousands separator
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-158009@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53791&edit=1

 ID:                 53791
 Updated by:         pajoye@php.net
 Reported by:        jinmoku at hotmail dot com
 Summary:            NumberFormat::parse fail with French thousands
                     separator
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            I18N and L10N related
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

Which ICU version do you use?


Previous Comments:
------------------------------------------------------------------------
[2011-01-19 16:52:43] jinmoku at hotmail dot com

Description:
------------
NumberFormat::parse fail with French thousands separator (space)

Test script:
---------------
$nombre = '1234,56';
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
var_dump($fmt->format($nombre));

$nombre = '1 234,56';
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
var_dump($fmt->parse($nombre));

$nombre = '1234,56';
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
var_dump($fmt->parse($nombre));

Expected result:
----------------
string(9) "1 234,56"
float(1234.56)
float(1234.56)


Actual result:
--------------
string(9) "1 234,56"
float(1)
float(1234.56)



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



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


Thread (15 messages)

« previous php.bugs (#158009) next »