-
Notifications
You must be signed in to change notification settings - Fork 42
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
UIU-2026 format currency values as currencies, not numbers #2611
Conversation
|
@vashjs The code coverage has to be at least 80%. |
@vashjs please create a ticket to cover new code with unit tests |
@Terala-Priyanka @mariia-aloshyna @Dmitriy-Litvinenko Since many files have changed, sonar showed all the places in the affected files where the team that owns the "ui-users" module did not cover the functionality with tests. Before my changes, the ui-users module had 70% coverage, after my changes it was 70.2%, I did not cause any damage to the module regarding coverage. PR before my stats: My PR stats: Next time please ping me in direct messages, people loosing mails time to time and I missed your comments, sorry about that. |
Ref: UIU-2026
So this module uses both classes and functional components; several localization methods were created for currency values.
useLocalizeCurrency
hook - for functionallocalizeCurrencyAmount
function - for class ones (but it is also part of the hook)After this PR is merged, all currency numbers will be with a prefix that corresponds to the currency (information about this exists in the stripes context).
Also in many places a small refactoring was made, and instead of
parseFloat(value).toFixed(2)
the util functionformatCurrencyAmount
was replaced.Please see screenshot with differences:
Before:
After:
NOTE: there aren't functional changes, so problems with coverage cames from previous implementation.