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

CLDR-11018 currency decimal place isn't accurate in the examples #3975

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Loading