summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDane Springmeyer <springmeyer@users.noreply.github.com>2019-11-12 06:47:43 -0800
committerGitHub <noreply@github.com>2019-11-12 06:47:43 -0800
commit49456e3fc15e173bc61dbac77d5096abf3650056 (patch)
treeb16eacc6e73c047a4c95ec0d4f2578ab3348d839
parent85c93e7e8348226425e6229bfcf963899d14a4f0 (diff)
downloadqtlocation-mapboxgl-49456e3fc15e173bc61dbac77d5096abf3650056.tar.gz
remove duplicate formatNumber (#15908)
-rw-r--r--platform/default/src/mbgl/i18n/format_number.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/platform/default/src/mbgl/i18n/format_number.cpp b/platform/default/src/mbgl/i18n/format_number.cpp
deleted file mode 100644
index 7b6f24221d..0000000000
--- a/platform/default/src/mbgl/i18n/format_number.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <mbgl/i18n/number_format.hpp>
-
-#include <unicode/numberformatter.h>
-
-namespace mbgl {
-namespace platform {
-
-std::string formatNumber(double number, const std::string& localeId, const std::string& currency,
- uint8_t minFractionDigits, uint8_t maxFractionDigits) {
-
- UErrorCode status = U_ZERO_ERROR;
- icu::UnicodeString ustr;
- std::string formatted;
-
- icu::Locale locale = icu::Locale(localeId.c_str());
- // Print the value as currency
- if (!currency.empty()) {
- icu::UnicodeString ucurrency = icu::UnicodeString::fromUTF8(currency);
- ustr = icu::number::NumberFormatter::with()
- .unit(icu::CurrencyUnit(ucurrency.getBuffer(), status))
- .locale(locale)
- .formatDouble(number, status)
- .toString();
- } else {
- ustr = icu::number::NumberFormatter::with()
-#if U_ICU_VERSION_MAJOR_NUM >= 62
- .precision(icu::number::Precision::minMaxFraction(minFractionDigits, maxFractionDigits))
-#else
- .rounding(icu::number::Rounder::minMaxFraction(minFractionDigits, maxFractionDigits))
-#endif
- .locale(locale)
- .formatDouble(number, status)
- .toString();
- }
- return ustr.toUTF8String(formatted);
-}
-
-} // namespace platform
-} // namespace mbgl