Skip to content

[intl] Use CLDR currency decimal/group separators in currency formats - #1128

Open
leonsteinmann wants to merge 1 commit into
dart-lang:mainfrom
leonsteinmann:intl-currency-separators
Open

leonsteinmann wants to merge 1 commit into
dart-lang:mainfrom
leonsteinmann:intl-currency-separators

Conversation

@leonsteinmann

Copy link
Copy Markdown

Fixes #1127

Adds optional currency-specific decimal and grouping separators to NumberSymbols, falling back to the general number separators when the currency-specific values are absent. Currency formatting now uses the currency separators, including parsing and compact currency formatting.

The generated number_symbols_data.dart data was hand-edited for de_AT and fr_CH, where the CLDR currency separators differ from the general number separators. This is a targeted data correction, not a broader CLDR refresh.

Validation:

  • dart format lib test
  • dart analyze
  • dart test (1,563 passed, 5 skipped)

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces support for currency-specific decimal and grouping separators in the intl package. By allowing these separators to be defined independently of standard number symbols, the package can now correctly handle locales where currency formatting conventions diverge from general numeric formatting, such as in de_AT and fr_CH. The changes include updates to the core data structures, formatting logic, and parser, ensuring consistent behavior across standard, simple, and compact currency formats.

Highlights

  • Currency-specific separators: Added CURRENCY_DECIMAL_SEP and CURRENCY_GROUP_SEP to NumberSymbols to support locale-specific currency formatting that differs from standard number formatting.
  • Logic updates: Updated NumberFormat and NumberParserBase to utilize these new currency-specific separators when formatting or parsing currency values.
  • Data corrections: Manually updated number_symbols_data.dart for de_AT and fr_CH to align with CLDR currency standards.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@google-cla

google-cla Bot commented Nov 6, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces CURRENCY_DECIMAL_SEP and CURRENCY_GROUP_SEP to NumberSymbols, allowing currency formatting to use different separators than standard number formatting for specific locales like fr_CH and de_AT. The NumberFormat and NumberParserBase classes have been updated to utilize these new separators. A critical logic bug was identified in number_parser_base.dart, where a tautological OR condition (||) always evaluates to true, bypassing the validation check for space-based grouping separators; this should be corrected to an AND (&&) operator.

@leonsteinmann
leonsteinmann force-pushed the intl-currency-separators branch from 0ebd144 to 4d17e03 Compare November 6, 2026 15:53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NumberFormat.currency ignores CLDR currencyDecimal / currencyGroup symbols (wrong output for fr_CH, de_AT)

1 participant