소스 검색

Eventual BG with 1 decimal in the app and watch app

- Use `targetFormatter` instead of `numberFormater` for `eventualBG` in the app, since this has the appropriate `maximumFractionDigits = 1`

- Change eventualFormatter to use `maximumFractionDigits = 1` instead of `2` on the watch
bjornoleh 1 년 전
부모
커밋
20ba334b2c
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      FreeAPS/Sources/Modules/Home/View/HomeRootView.swift
  2. 1 1
      FreeAPS/Sources/Services/WatchManager/WatchManager.swift

+ 1 - 1
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -344,7 +344,7 @@ extension Home {
 
                     if let eventualBG = state.eventualBG {
                         Text(
-                            "⇢ " + numberFormatter.string(
+                            "⇢ " + targetFormatter.string(
                                 from: (state.units == .mmolL ? eventualBG.asMmolL : Decimal(eventualBG)) as NSNumber
                             )!
                         )

+ 1 - 1
FreeAPS/Sources/Services/WatchManager/WatchManager.swift

@@ -216,7 +216,7 @@ final class BaseWatchManager: NSObject, WatchManager, Injectable {
     private var eventualFormatter: NumberFormatter {
         let formatter = NumberFormatter()
         formatter.numberStyle = .decimal
-        formatter.maximumFractionDigits = 2
+        formatter.maximumFractionDigits = 1
         return formatter
     }