From:             
Operating system: MacOS X 10.6.6
PHP version:      5.3.5
Package:          *Languages/Translation
Bug Type:         Bug
Bug description:NumberFormatter returns NaN when converting float point

Description:
------------
In PHP 5.3.5, giving float point values to numfmt_format doesn't work when


setlocale is set to a country using comma instead of dot in floating
point.



Also does not work in PHP 5.3.4 (FreeBSD)



DOES work on 5.3.3 (FreeBSD)





Perhaps interesting notes from my configuration:



intl

Internationalization support => enabled

version => 1.1.0

ICU version => 4.6



Directive => Local Value => Master Value

intl.default_locale => no value => no value

intl.error_level => 0 => 0

Test script:
---------------
<?php

$fmt = numfmt_create("da_DK", \NumberFormatter::CURRENCY);



echo numfmt_format($fmt, 5.5)."\n";

setlocale(LC_ALL, "da_DK.UTF-8");



echo numfmt_format($fmt, 5.5)."\n";

echo numfmt_format($fmt, "5,5")."\n";

Expected result:
----------------
5,50 kr

5,50 kr

5,00 kr

Actual result:
--------------
5,50 kr

NaN

5,00 kr

-- 
Edit bug report at http://bugs.php.net/bug.php?id=53735&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53735&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53735&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53735&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53735&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53735&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53735&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53735&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53735&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53735&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53735&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53735&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53735&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53735&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53735&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53735&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53735&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53735&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53735&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53735&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53735&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53735&r=mysqlcfg

Reply via email to