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

fix: keep always two digits at PieWidgetUI default percentFormatter #850

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

jantolg
Copy link
Contributor

@jantolg jantolg commented Mar 6, 2024

Description

Related by: #844

Keep two decimals always in default percent formatters in PieWidgetUI

Type of change

  • Fix

Acceptance

Please describe how to validate the feature or fix

  1. go to PieWidgetUI
  2. Check percents format should have two decimals always, if you didn't defined a different percentFormatter

@jantolg jantolg requested a review from padawannn March 6, 2024 14:34
Copy link

github-actions bot commented Mar 6, 2024

Pull Request Test Coverage Report for Build 8173764685

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 68.561%

Totals Coverage Status
Change from base Build 8170229593: 0.0%
Covered Lines: 2630
Relevant Lines: 3493

💛 - Coveralls

@jantolg jantolg requested a review from vmilan March 6, 2024 14:35
Copy link

github-actions bot commented Mar 6, 2024

Visit the preview URL for this PR (updated for commit ade9afa):

https://cartodb-fb-storybook-react-dev--pr850-fix-keep-two-dec-zya52p6w.web.app

(expires Wed, 13 Mar 2024 14:37:42 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 517cc4d31d7e09cf277774e034094b67c301cd4c

@@ -71,7 +71,11 @@ function PieWidgetUI({
const _percentFormatter = useMemo(
() =>
percentFormatter ||
((v) => `${intl.formatNumber(v, { maximumFractionDigits: 2 })}%`),
((v) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this has caused problems with e2e, please double-check the case when total === 0, it should returns 0,00%

It was also modified in your last PR -> https://github.com/CartoDB/carto-react/pull/844/files#diff-aef7c79c208e732a247556c69887e48f3f8b2076d3bf28aeeb9abde1419806adL98-L99

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked

@padawannn padawannn merged commit 401e616 into master Mar 7, 2024
2 checks passed
@padawannn padawannn deleted the fix/keep-two-decimals-pie-widget branch March 7, 2024 08:24
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.

None yet

3 participants