Currency rate: always display minimum 4 significant decimals or 2 trailing zeros if the number is integer (#256)

* Currency rate: Compute how many decimals we need to display two meaningful digits at minimum

* formatting

* nit

* Increase the number of meaningfull digits (2->4)

* Revert "Increase the number of meaningfull digits (2->4)"

This reverts commit 9ad93e0d591a386e3e229e09b39a58158d544069.

* Rename constants

* modify FORMATTER_RATE_* values

* format CurrencyConverterUnitTests.cpp
This commit is contained in:
Rudy Huyn
2019-08-01 15:07:27 -07:00
committed by Stephanie Anderl
parent 796d171960
commit cc8491a3d7
3 changed files with 56 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
@@ -75,6 +75,7 @@ namespace CalculatorApp
std::pair<std::wstring, std::wstring>
GetCurrencyRatioEquality(_In_ const UnitConversionManager::Unit& unit1, _In_ const UnitConversionManager::Unit& unit2) override;
std::wstring GetCurrencyTimestamp() override;
static double RoundCurrencyRatio(double ratio);
std::future<bool> TryLoadDataFromCacheAsync() override;
std::future<bool> TryLoadDataFromWebAsync() override;