-
-
Notifications
You must be signed in to change notification settings - Fork 939
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(commerce): return fractional prices #2458
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #2458 +/- ##
=======================================
Coverage 99.56% 99.56%
=======================================
Files 2846 2846
Lines 248656 248715 +59
Branches 642 654 +12
=======================================
+ Hits 247581 247643 +62
+ Misses 1075 1072 -3
|
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.
There are some prices that are like 1.20€ like a serving of ice. |
I think a more realistic algorithm for prices might be:
|
Also, when you convert a price from one currency to another, you often get something like "$120.14". |
Team Decision We will alter the distribution to favor the special numbers by using faker.helpers.weightedArrayElement for the last decimal digit.
If the dec is zero we will skip this behavior. |
@ST-DDT Could you please take this over? |
Sure no problem. This might take a bit though. |
Here a few prices that are returned by the price method: Summary
Values
|
Ready for review |
While it's not strictly a breaking change I think it's worth a mention in the migration guide given that it changes the behavior of the method. |
Added |
closes #350