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

 ID:                 54163
 Comment by:         Louis dot cellier at hotmail dot com
 Reported by:        lingtalfi at gmail dot com
 Summary:            get NaN with intl MessageFormatter or
                     NumberFormatter
 Status:             Open
 Type:               Bug
 Package:            I18N and L10N related
 Operating System:   MacOsX 10.6.6
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

Don't want to be rude. Can you show your array $data used on this
exemple ?


Previous Comments:
------------------------------------------------------------------------
[2011-03-04 22:42:02] lingtalfi at gmail dot com

Description:
------------
Hi, I use macport php5.3 and intl



my configuration 

Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/1.0.0d DAV/2 PHP/5.3.5 



trying intl functions, I get NaN value instead of expected (int) value.

Also had similar issue with NumberFormatter.

Test script:
---------------
    $format_FR = 'Le {0,date,full} à {1,time,short}, {2,number,integer}
pommes coûtent {3,number,currency}';

    $format_US = 'On {0,date,full} at {1,time,short}, {2,number,integer}
apples cost {3,number,currency}';

    $data = array(time(), time(), 5, 3);

    echo MessageFormatter::formatMessage('fr_FR', $format_FR, $data) .
"<br />";

    echo MessageFormatter::formatMessage('en_US', $format_US, $data) .
"<br />";

Expected result:
----------------
Le vendredi 4 mars 2011 à 22:37, 5 pommes coûtent 3 €

On Friday, March 4, 2011 at 10:37 PM, 5 apples cost $3



Actual result:
--------------
Le vendredi 4 mars 2011 à 22:37, 5 pommes coûtent NaN

On Friday, March 4, 2011 at 10:37 PM, 5 apples cost NaN


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



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

Reply via email to