diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleGenerator.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleGenerator.java index 62e3ce503ae..9d3a458ba7c 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleGenerator.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleGenerator.java @@ -76,6 +76,7 @@ import org.unicode.cldr.util.ScriptToExemplars; import org.unicode.cldr.util.SimpleUnicodeSetFormatter; import org.unicode.cldr.util.SupplementalDataInfo; +import org.unicode.cldr.util.SupplementalDataInfo.CurrencyNumberInfo; import org.unicode.cldr.util.SupplementalDataInfo.PluralInfo; import org.unicode.cldr.util.SupplementalDataInfo.PluralInfo.Count; import org.unicode.cldr.util.SupplementalDataInfo.PluralType; @@ -2740,6 +2741,14 @@ private void handleCurrencyFormat( icuServiceBuilder.getCurrencyFormat(currency, currencySymbol, numberSystem); df.applyPattern(value); + // getCurrencyFormat sets digits, but applyPattern seems to overwrite it, so fix it again + // here + SupplementalDataInfo supplementalData = CONFIG.getSupplementalDataInfo(); + CurrencyNumberInfo info = supplementalData.getCurrencyNumberInfo(currency); + int digits = info.getDigits(); + df.setMinimumFractionDigits(digits); + df.setMaximumFractionDigits(digits); + String countValue = parts.getAttributeValue(-1, "count"); if (countValue != null) { examples.add(formatCountDecimal(df, countValue));