Skip to content

Commit

Permalink
add missing formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
mountrcg committed May 18, 2024
1 parent b1dbafd commit 77342cc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion FreeAPS/Sources/Modules/Home/HomeStateModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ extension Home {
@Published var overrides: [Override] = []
@Published var alwaysUseColors: Bool = true
@Published var timeSettings: Bool = true
@Published var calculatedTins: String = ""

static let numberFormatter: NumberFormatter = {
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
formatter.maximumFractionDigits = 2
return formatter
}()

let coredataContext = CoreDataStack.shared.persistentContainer.viewContext

Expand Down Expand Up @@ -349,7 +357,7 @@ extension Home {
debug(.default, "totalBoluses: \(totalBoluses)")
debug(.default, "basalInsulinForCurrentDay: \(basalInsulinForCurrentDay)")

calculatedTins = AllFormatters.numberFormatter.string(from: total as NSNumber) ?? "NaN"
calculatedTins = Home.StateModel.numberFormatter.string(from: total as NSNumber) ?? "NaN"

return calculatedTins
}
Expand Down

0 comments on commit 77342cc

Please sign in to comment.