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

fix(fmt): fix the case when mantissa exceeds 10 by rounding and exponent is negative #5279

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jul 3, 2024

Currently e formatting with rounding has a bug in some edge cases. For example sprintf("%.3e", 0.000099999) becomes 1.000e--04 (which has double minus sign). This PR fixes it.

@github-actions github-actions bot added the fmt label Jul 3, 2024
Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.76%. Comparing base (fc2975b) to head (c9989b1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5279   +/-   ##
=======================================
  Coverage   95.76%   95.76%           
=======================================
  Files         457      457           
  Lines       37955    37955           
  Branches     5569     5569           
=======================================
+ Hits        36346    36347    +1     
+ Misses       1568     1567    -1     
  Partials       41       41           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@kt3k kt3k merged commit 442a497 into denoland:main Jul 4, 2024
12 checks passed
@kt3k kt3k deleted the fix-fmt-printf-e branch July 4, 2024 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants