Skip to content

Draft: Datagen validation for currency vs decimal pattern grouping#8160

Draft
younies wants to merge 2 commits into
unicode-org:mainfrom
younies:currency-pattern-validation
Draft

Draft: Datagen validation for currency vs decimal pattern grouping#8160
younies wants to merge 2 commits into
unicode-org:mainfrom
younies:currency-pattern-validation

Conversation

@younies

@younies younies commented Jun 30, 2026

Copy link
Copy Markdown
Member

Description

This is a draft PR intended to demonstrate our findings regarding the consistency of digit grouping between decimal and currency patterns in CLDR.

We have added a validation check to the currency data generator (validate_integer_structures in provider/source/src/currency/essentials.rs) that compares the integer structure (grouping sizes and digit placeholders) of all currency patterns (standard, accounting, and their alphaNextToNumber variants) against the locale's standard decimal pattern.

Findings

  1. Core Consistency: For almost all locales, the core numeric grouping matches exactly between decimal and currency patterns (e.g., both use #,##0 in en, and #,##,##0 in bn).
  2. Exceptions/Mismatches: We identified a mismatch in the ccp (Chakma) locale:
    • Decimal Standard: #,##,##0.### (Indian grouping)
    • Currency Standard: #,##,##0.00¤ (Indian grouping)
    • Currency alphaNextToNumber (standard and accounting): ¤ #,##0.00 (Western grouping: #,##0)
    • This seems to be an inconsistency in CLDR.

Changelog

  • Adds integer_structure to NumberPattern to extract grouping/digit placeholders.
  • Adds validate_integer_structures in essentials.rs to assert equality during datagen.
  • Adds an exception for ccp to print a WARNING instead of failing the build, allowing tests to pass.

This PR is a demonstration of the validation logic and the CLDR consistency.

Instead of skipping validation for ccp, patch the patterns in datagen so that the generated data is correct and matches the validation.

TAG=agy

CONV=d0d58281-2fac-42d4-823d-fa0a12744232
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.

1 participant