[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
Mon Nov 1 12:49:49 PDT 2010


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





--- Comment #26 from Gavin Barraclough <barraclough at apple.com>  2010-11-01 12:49:48 PST ---
One more quick thought, the method for rounding I described might cause some issues for very large/small values.

- The decimal-places check I described would not work for values with an exponential string representation – I'd suggest checking base/step for index('e'), and if it is found in either then don't perform the additional truncation.

- Also, for large values of newValue, the truncation may result in the value overflowing to infinity, so I'd suggest only rounding where (newValue < 10^21).  (This limit is the matches the cut-off where ToString conversion switches to exponential, and since values above this limit never have any decimal places in their representation we have nothing to truncate here anyway).

cheers,
G.

-- 
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