Open
Description
There are multiple number parsing algorithms on the platform:
- CSS (/cc @tabatkins): https://drafts.csswg.org/css-syntax/#consume-a-number (mathematical decimal value)
- HTML: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#numbers (integers + non-negative integers + floating point)
- JSON: http://json.org/ "number" production (mathematical decimal value) (should be the same as the Ecma 404 PDF but haven't checked) (Tab says this is the same as CSS)
- TC39/@mathiasbynens are maybe working on one in https://github.com/mathiasbynens/proposal-number-fromstring, although it's unclear how generic it's supposed to be; still under discussion. (Notable: supports multiple radices)
It seems ideal to me if at least some of these could be shared. Maybe just between JSON and CSS, and HTML has extensions to it? I need to audit the potential differences.
Metadata
Metadata
Assignees
Labels
No labels