Parsing a float with parseFloat() doesn't work with Euro symbol suffix. Sample script: <script> alert(parseFloat("1.0€")); </script> parseFloat returns NaN and NOT the expected value as float object; This script works as expected: <script> alert(parseFloat("1.0$")); </script> My Test System: Windows XP SP2 Safari 3.0.4 beta (523.15) with WebKit-r28899
Confirmed on Mac OS X with both Safari 3.0.4 and TOT WebKit.
From ustring.cpp: 954 // FIXME: If tolerateTrailingJunk is true, then we want to tolerate non-8-bit junk 955 // after the number, so is8Bit is too strict a check. 956 if (!is8Bit()) 957 return NaN;
This bug is a duplicate of Bug 31349
This major data processing Javascript function is still broken....
Well, if it’s major, then ... ;-)
Well, to be serious, I was looking at this code recently and thinking I wanted to fix it, so I’ll grab this bug.
*** Bug 31349 has been marked as a duplicate of this bug. ***
This was fixed in <http://trac.webkit.org/changeset/56560>.
However `Number('\u00A0')` still returns `NaN` (in today's nightly), so bug 31349 seems to be still in effect.