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 913e4884462..c6edf2a1dbf 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 @@ -75,6 +75,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; @@ -2685,6 +2686,14 @@ private String handleCurrencyFormat(XPathParts parts, String value, boolean show 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) { return formatCountDecimal(df, countValue);