json-formula icon indicating copy to clipboard operation
json-formula copied to clipboard

Incorrect non-10-base floating point parsing with spaces

Open Eswcvlad opened this issue 1 year ago • 0 comments

Looks like spaces at the end count as the fractional part, which ruins the result:

toNumber("070.070", 8) -> 56.109375 toNumber("070.070 ", 8) -> 56.013671875 toNumber("070.070 ", 8) -> 56.001708984375

toNumber("0F0.0F0", 16) -> 240.05859375 toNumber("0F0.0F0 ", 16) -> 240.003662109375 toNumber("0F0.0F0 ", 16) -> 240.00022888183594

Eswcvlad avatar Jul 19 '24 18:07 Eswcvlad