Przeglądaj źródła

fix(watchmanager): correctly formatting glucose string

Signed-off-by: Sjoerd Bozon <sjoerd.bozon@gmail.com>
Sjoerd Bozon 1 rok temu
rodzic
commit
689e93a95a

+ 1 - 1
Trio/Sources/Services/WatchManager/AppleWatchManager.swift

@@ -206,7 +206,7 @@ final class BaseWatchManager: NSObject, WCSessionDelegate, Injectable, WatchMana
                 watchState.currentGlucose = "\(latestGlucose.glucose)"
             } else {
                 let mgdlValue = Decimal(latestGlucose.glucose)
-                let latestGlucoseValue = Double(truncating: mgdlValue.asMmolL as NSNumber)
+                let latestGlucoseValue = mgdlValue.formattedAsMmolL
                 watchState.currentGlucose = "\(latestGlucoseValue)"
             }