[Webkit-unassigned] [Bug 48308] Too precise serialization from floating point number to string for "number" input elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 28 23:33:16 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=48308





--- Comment #10 from Kent Tamura <tkent at chromium.org>  2010-10-28 23:33:15 PST ---
(In reply to comment #9)
> Unfortunately, casting to float and printing with numberToString() don't work. The original numberToString() try printing numbers with 16-17 digits. Then, for example,
> > setValueAsNumberAndGetValue(-1.2)
> is printed as
> > -1.2000000476837158
> with casting to float.

ok.

> What do you think about adding another numberToString with a different signature without rewriting the original numberToString? It's to avoid rewriting the original numberToString, but also to make it easy to keep following with future changes on the original numberToString. My first idea here was to print with limited digits by the same logic as JavaScript's ToString.

I think using DecimalNumber in HTMLParserIdioms as Gavin wrote is better. because HTML floating pint number doesn't need NaN/Infinity handling, so it is so different from the existing numberToString().

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



More information about the webkit-unassigned mailing list