Skip to content
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

Default number formatting is not spec compliant #413

Closed
HalidOdat opened this issue May 24, 2020 · 2 comments
Closed

Default number formatting is not spec compliant #413

HalidOdat opened this issue May 24, 2020 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@HalidOdat
Copy link
Member

HalidOdat commented May 24, 2020

Describe the bug

Currently we use the default native Rust formatter to format floating-point numbers, which is not spec compliant.

To Reproduce
Steps to reproduce the issue, or JavaScript code that causes this failure.

This JavaScript code reproduces the issue:

0.0000001
3.e50

Expected behavior

In this scenario we should get 1e-7 and 3e+50 back.
Actual output is 0.0000001 and 300000000000000000000000000000000000000000000000000.

Build environment (please complete the following information):

  • OS: Manjaro Linux
  • Target triple: x86_64-unknown-linux-gnu
  • Rustc version: 1.43.1 (8d69840ab 2020-05-04)

Additional context

We need to write our own f64 formatter like V8 DoubleToCString (see V8 implementation link bellow)

You can find more information:

@HalidOdat HalidOdat added bug Something isn't working good first issue Good for newcomers labels May 24, 2020
@HalidOdat HalidOdat changed the title Default number formating is not spec compliant Default number formatting is not spec compliant May 24, 2020
@HalidOdat HalidOdat assigned HalidOdat and unassigned HalidOdat May 24, 2020
@Tropid
Copy link
Contributor

Tropid commented Jun 11, 2020

I can take this if nobody else wants it :)

@HalidOdat
Copy link
Member Author

I can take this if nobody else wants it :)

Sure! Tell us if you need any help, or if you have any questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants