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

feat: add round away from zero and fix StringFixed issue #24

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

quagmt
Copy link
Owner

@quagmt quagmt commented Nov 12, 2024

Description

This PR includes:

  1. Add RoundAwayFromZero
  • Initially the name for this method is RoundToInf but I think people might mistakenly assume that RoundToInf is rounding to positive infinity. Renaming it to RoundAwayFromZero provides more clarity and helps avoid confusion
  • The name is also verbose unlike RoundHAZ and RoundHTZ. That's because short from of this method method is RoundAZ which looks very similar to RoundHAZ if we just glance. Also I feel like make it verbose will help reduce the cognitive complexity (no more mapping RoundAZ = Round Away From Zero). It's also good to rename RoundHAZ to RoundHalfAwayZero so it's consistent and less complex but that change is beyond the scope of this PR
  1. Fix StringFixed() issue described in StringFixed fixed rounding does not work as expected for fixed numbers #23

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.89%. Comparing base (5a55047) to head (e506607).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #24      +/-   ##
==========================================
+ Coverage   95.79%   95.89%   +0.09%     
==========================================
  Files           5        5              
  Lines        1713     1752      +39     
==========================================
+ Hits         1641     1680      +39     
  Misses         48       48              
  Partials       24       24              

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

@quagmt quagmt force-pushed the feat/add-round-away-from-zero branch from bd7d452 to 41efb38 Compare November 12, 2024 13:49
@quagmt quagmt merged commit a5482f2 into master Nov 12, 2024
9 checks passed
@quagmt quagmt deleted the feat/add-round-away-from-zero branch November 14, 2024 01:23
@quagmt quagmt changed the title Feat: add round away from zero and fix StringFixed issue feat: add round away from zero and fix StringFixed issue Nov 15, 2024
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.

1 participant