Description
Describe the bug
The output is incorrect when rounding with 5 as the last digit.
(25).toExponential(0), // Should return "3e+1", actual "2e+1"
(12345).toExponential(3) // Should return "1.235e+4", actual "1.234e+4"
This cause the last built-in Number
test262 test to fail: https://github.com/tc39/test262/blob/main/test/built-ins/Number/prototype/toExponential/return-values.js
Already have the issue in the ryu-js
crate boa-dev/ryu-js#31, just leaving this issue to avoid duplicate work, trying to fix the hacky solution with format!
😅
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Progress