Number.fromString does not parse all number strings
Closed this issue · 2 comments
domenic commented
In particular, Number.fromString(123.456.toString())
produces 123
(or would produce an error if #5 was implemented). I'd expect 123.456
.
mathiasbynens commented
a29f339 includes this change — compare step 9 in both algorithms. Please take a look and let me know of any issues.
JTBrinkmann commented
This proposal's motivation is stated to offer a way to invert {BigInt,Number}.prototype.toString(radix)
, yet the specs and README only focus on integers, despite Number.prototype.toString(radix)
potentially returning string representation of non-integer numbers.
a29f339 does not "include this change", instead it causes a SyntaxError to be thrown.
I'd expect
123.456