-
Notifications
You must be signed in to change notification settings - Fork 120
[Analytics Hub] Add formatters for net revenue stats data #8207
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
Conversation
You can test the changes from this Pull Request by:
|
Ecarrion
left a comment
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.
👍
|
|
||
| // If revenue is an integer, no decimal points are shown. | ||
| let numberOfDecimals: Int? = revenue.isInteger ? 0 : nil | ||
| let currencyFormatter = currencyFormatter ?? CurrencyFormatter(currencySettings: ServiceLocator.currencySettings) |
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.
nit: you can set the formatter as a default parameter to make the code a bit clean.
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.
👍 Updated in a8fb169
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.
LGTM ![]()
P.S. I missed other review 😄
|
|
||
| // If revenue is an integer, no decimal points are shown. | ||
| let numberOfDecimals: Int? = revenue.isInteger ? 0 : nil | ||
| let currencyFormatter = currencyFormatter ?? CurrencyFormatter(currencySettings: ServiceLocator.currencySettings) |
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.
nit: I feel this is more readable when we declare default value near the non-optional func parameter.
Now passing nil means using default value, but it is not obvious from outside of the function.
Generated by 🚫 dangerJS |
Part of #8150
Description
This PR adds methods to retrieve and format the net revenue value and delta used for the "Net Sales" column on the Revenue Analytics card:
Testing
These methods aren't yet used in the app; confirm the unit tests are checking the correct values and tests pass.
Submitter Checklist
Update release notes:
RELEASE-NOTES.txtif necessary.