Skip to content
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
14 changes: 10 additions & 4 deletions icuSources/i18n/number_formatimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,16 @@ NumberFormatterImpl::macrosToMicroGenerator(const MacroProps& macros, bool safe,
// TODO: Accept currency symbols from DecimalFormatSymbols?

// Pre-compute a few values for efficiency.
bool isCurrency = utils::unitIsCurrency(macros.unit);
bool isBaseUnit = utils::unitIsBaseUnit(macros.unit);
bool isPercent = utils::unitIsPercent(macros.unit);
bool isPermille = utils::unitIsPermille(macros.unit);

// SwiftFoundationICU temporary changes begin:
// Capture macros.unit to ensure we are loading
// the "correct" MeasureUnit object from the package.
auto unit = macros.unit;
bool isCurrency = utils::unitIsCurrency(unit);
bool isBaseUnit = utils::unitIsBaseUnit(unit);
bool isPercent = utils::unitIsPercent(unit);
bool isPermille = utils::unitIsPermille(unit);
// SwiftFoundationICU temporary changes end
bool isCompactNotation = macros.notation.fType == Notation::NTN_COMPACT;
bool isAccounting =
macros.sign == UNUM_SIGN_ACCOUNTING ||
Expand Down