Skip to content

Commit

Permalink
ICU-22950 Do not initialize currency redandantly - fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nightelf3 committed Oct 25, 2024
1 parent 937f002 commit 85c713b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion icu4c/source/i18n/number_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ MacroProps NumberPropertyMapper::oldToNew(const DecimalFormatProperties& propert
}
Precision precision;
if (!properties.currencyUsage.isNull()) {
U_ASSERT(useCurrency);
precision = Precision::constructCurrency(currencyUsage).withCurrency(currency);
} else if (roundingIncrement != 0.0) {
if (PatternStringUtils::ignoreRoundingIncrement(roundingIncrement, maxFrac)) {
Expand Down Expand Up @@ -278,7 +279,7 @@ MacroProps NumberPropertyMapper::oldToNew(const DecimalFormatProperties& propert
exportedProperties->maximumIntegerDigits = maxInt == -1 ? INT32_MAX : maxInt;

Precision rounding_;
if (precision.fType == Precision::PrecisionType::RND_CURRENCY) {
if (useCurrency && precision.fType == Precision::PrecisionType::RND_CURRENCY) {
rounding_ = precision.withCurrency(currency, status);
} else {
rounding_ = precision;
Expand Down

0 comments on commit 85c713b

Please sign in to comment.