Edit report at https://bugs.php.net/bug.php?id=55290&edit=1

 ID:                 55290
 User updated by:    franssen dot roland at gmail dot com
 Reported by:        franssen dot roland at gmail dot com
 Summary:            \NumberFormatter::parseCurrency() fails
 Status:             Open
 Type:               Bug
 Package:            I18N and L10N related
-Operating System:   Ubuntu 11.04
+Operating System:   Linux
-PHP Version:        5.3.6
+PHP Version:        5.3.6 - 5.3.8
 Block user comment: N
 Private report:     N

 New Comment:

Still fails in 5.3.8...
However it does seems to work when parsing in locale en[_US], e.g. $1 returns 
float(1) ("USD"). Didn't spot any other locales that work (mostly tested 
european locales; netherlands, germany, french)


Previous Comments:
------------------------------------------------------------------------
[2011-07-28 07:04:52] franssen dot roland at gmail dot com

Same code does works on PHP 5.2.17 (Linux)

version         1.0.3
ICU version     3.6

------------------------------------------------------------------------
[2011-07-26 20:23:42] franssen dot roland at gmail dot com

Description:
------------
Hi,

The example code at 
http://nl2.php.net/manual/en/numberformatter.parsecurrency.php doesn't seem to 
work for me.

This is perhaps also related to bug #54163 (?)

---

version        1.1.0
ICU version    4.4.1

Directive              Local Value    Master Value
intl.default_locale    no value       no value
intl.error_level       0              0

Test script:
---------------
<?php
$fmt = numfmt_create( 'de_DE', NumberFormatter::CURRENCY );
$num = "1.234.567,89 $";
echo "We have ".numfmt_parse_currency($fmt, $num, $curr)." in $curr\n";
echo \PHP_EOL;

$fmt = new NumberFormatter( 'de_DE', NumberFormatter::CURRENCY );
$num = "1.234.567,89 $";
echo "We have ".$fmt->parseCurrency($num, $curr)." in $curr\n";
die;

Expected result:
----------------
We have 1234567.89 in USD
We have 1234567.89 in USD

Actual result:
--------------
We have <FALSE> in <NULL>
We have <FALSE> in <NULL>


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



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

Reply via email to