[Webkit-unassigned] [Bug 16162] New: [gtk] parseFloat depends on locale setting

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 27 11:54:07 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=16162

           Summary: [gtk] parseFloat depends on locale setting
           Product: WebKit
           Version: 523.x (Safari 3)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Major
          Priority: P2
         Component: WebKit Gtk
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: pierre-luc.beaudoin at collabora.co.uk
                CC: alp at atoker.com


Parsing a float with parseFloat() doesn't return the same result for all
locales.    

Sample script:
<script>
var input = prompt("Enter 0,5 or 0.5");
var test = 0.5;
if(input != null)
    test = parseFloat(input);
alert(eval("test == 0.5"));
alert(eval("test == '0.5'"));
if(test == 0.5)
    alert("Works!");
else
    alert("Pain!");
</script>

Tests data:
en_US: 
Entering 0.5 will produce true, true, then Works!
fr_CA:
Entering 0.5 will produce false, true then Pain!
Entering 0,5 will produce true, false, then Works!

Expected results (if parseFloat shouldn't use locale):
en_US: 
Entering 0.5 will produce true, true, then Works!
fr_CA:
Entering 0.5 will produce true, true, then Works!
Entering 0,5 will produce false, false, then Pain! (I guess)


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list