Skip to content

Commit

Permalink
Eventual BG with 1 decimal in the app and watch app
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
bjornoleh committed Jun 17, 2024
1 parent 82f2d01 commit 20ba334
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FreeAPS/Sources/Modules/Home/View/HomeRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
)!
)
Expand Down
2 changes: 1 addition & 1 deletion FreeAPS/Sources/Services/WatchManager/WatchManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 20ba334

Please sign in to comment.