Skip to content

Conversation

@gbrail
Copy link
Collaborator

@gbrail gbrail commented Oct 28, 2025

This PR continues the work on number formatting.

It is stacked on top of #2132

It replaces the Number operations:

  • toExponential
  • toFixed
  • toPrecision

with new implementations that use BigDecimal. It also uses the new double formatter in some cases.

The new implementations work correctly for all double values in the test data that we can find, and are faster besides.

This and the first PR also fix the very old issue #254

@gbrail gbrail marked this pull request as ready for review November 1, 2025 19:55
This replaces the implementations of toExponential, toFixed,
and toPrecision on the Number class with new implementations that use
a combination of BigDecimal and the new double formatting code.
@gbrail gbrail merged commit f7341b4 into mozilla:master Nov 2, 2025
11 checks passed
@gbrail gbrail deleted the greg-new-dtoa-5 branch November 2, 2025 18:46
@rbri
Copy link
Collaborator

rbri commented Nov 2, 2025

cool

@p-bakker
Copy link
Collaborator

p-bakker commented Nov 3, 2025

@gbrail should #254 not be closed now?

Doesn't happen automatically (unless using the specific GitHub syntax for it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants