From b1600bee6002cbeeff5fe76d0b2dbe6b7c516445 Mon Sep 17 00:00:00 2001 From: Hongxu Xu Date: Sat, 14 Nov 2020 10:13:12 +0800 Subject: [PATCH] Add comment for a line of code --- src/CalcViewModel/UnitConverterViewModel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CalcViewModel/UnitConverterViewModel.cpp b/src/CalcViewModel/UnitConverterViewModel.cpp index 25be7c74..37e726ee 100644 --- a/src/CalcViewModel/UnitConverterViewModel.cpp +++ b/src/CalcViewModel/UnitConverterViewModel.cpp @@ -396,8 +396,6 @@ String ^ UnitConverterViewModel::ConvertToLocalizedString(const std::wstring& st // Copy back the edited string to the result result = ref new String(resultWithDecimal.c_str()); } - - currencyFormatter->FractionDigits = lastCurrencyFractionDigits; } wstring resultHolder = wstring(result->Data()); @@ -409,6 +407,10 @@ String ^ UnitConverterViewModel::ConvertToLocalizedString(const std::wstring& st } result = L"-" + result; } + + // restore the original fraction digits + currencyFormatter->FractionDigits = lastCurrencyFractionDigits; + return result; }