Boa: Default number formatting is not spec compliant

Created on 24 May 2020  路  2Comments  路  Source: boa-dev/boa

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:

bug good first issue

Most helpful comment

I can take this if nobody else wants it :)

All 2 comments

I can take this if nobody else wants it :)

I can take this if nobody else wants it :)

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jedmao picture jedmao  路  12Comments

hello2dj picture hello2dj  路  23Comments

HalidOdat picture HalidOdat  路  18Comments

jasonwilliams picture jasonwilliams  路  12Comments

Razican picture Razican  路  14Comments