From c0193a64fdc0b24e83eb6efb88e9c257eda27896 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Sat, 5 Dec 2020 22:14:51 +0100 Subject: [PATCH] - fix inconsistent temperate units for different locales (set us_US locale) (#166) --- StatsKit/helpers.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StatsKit/helpers.swift b/StatsKit/helpers.swift index abf1b9b3..644609c7 100644 --- a/StatsKit/helpers.swift +++ b/StatsKit/helpers.swift @@ -659,9 +659,9 @@ public func LocalizedString(_ key: String, _ params: String..., comment: String public func Temperature(_ value: Double) -> String { let stringUnit: String = Store.shared.string(key: "temperature_units", defaultValue: "system") let formatter = MeasurementFormatter() + formatter.locale = Locale.init(identifier: "en_US") formatter.numberFormatter.maximumFractionDigits = 0 formatter.unitOptions = .providedUnit - formatter.unitStyle = .short var measurement = Measurement(value: value, unit: UnitTemperature.celsius) if stringUnit != "system" {