-
-
Notifications
You must be signed in to change notification settings - Fork 919
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(number): improve float generation for precisions of form 10^-n #2581
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #2581 +/- ##
==========================================
- Coverage 99.57% 99.56% -0.01%
==========================================
Files 2807 2807
Lines 250374 250379 +5
Branches 1141 1137 -4
==========================================
- Hits 249314 249301 -13
- Misses 1032 1050 +18
Partials 28 28
|
Note this obviously conflicts with #2564, probably easiest to merge that first since it touches more code |
And thanks for tackling this ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't have enough free time to look at the precision behavior yet.
Thanks for addressing all my comments 👍 |
fix #2567
Changes the way that the 1/precision is calculated in faker.number.float() using Math.log10 and Math.pow
This ensures that if precision is 0.00001, you get exactly 100000 for example, not 99999.99999999999