-
-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong result from Number.prototype.toFixed
#2609
Comments
As per my understanding this is because of boa/boa_engine/src/builtins/number/mod.rs Line 281 in 4750e8d
Which, as rust-lang/rust#102935 shows, Rust's format! rounds x.5 to whichever even number is closest.So 1.25.toFixed(1) rounds down to 1.2 but 1.35.toFixed(1) rounds up to 1.4 .
|
Is there any progress here?
Originally posted by @raskad in #1620 (comment) I have found a recommended fix mentioned in this issue, and I believe it should be implemented in ryu-js. |
I think putting it in the
I don't think there has been any work done on this, I created Issues to track the progress (boa-dev/ryu-js#33, boa-dev/ryu-js#32, boa-dev/ryu-js#31) |
I have started work on |
Describe the bug
Wrong result from
Number.prototype.toFixed
To Reproduce
Expected behavior
Running this code,
a
should be set to"1.3"
and printed, buta
is instead set to"1.2"
. The expected behaviour can be found in the ECMAScript specification.Build environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: