Przeglądaj źródła

Fix double conversion when using .formattedAsMmolL

Deniz Cengiz 1 rok temu
rodzic
commit
79ab766dff

+ 1 - 1
FreeAPS/Sources/Modules/Bolus/View/ForeCastChart.swift

@@ -45,7 +45,7 @@ struct ForeCastChart: View {
                 if let eventualBG = state.simulatedDetermination?.eventualBG {
                     HStack {
                         Text(
-                            units == .mgdL ? Decimal(eventualBG).description : eventualBG.asMmolL.formattedAsMmolL
+                            units == .mgdL ? Decimal(eventualBG).description : eventualBG.formattedAsMmolL
                         )
                         .font(.footnote)
                         .foregroundStyle(.primary)

+ 1 - 1
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -385,7 +385,7 @@ extension MainChartView {
                 }.font(.body).padding(.bottom, 5)
 
                 HStack {
-                    Text(units == .mgdL ? glucoseToShow.description : glucoseToShow.formattedAsMmolL)
+                    Text(units == .mgdL ? glucoseToShow.description : Decimal(sgv).formattedAsMmolL)
                         .bold()
                         + Text(" \(units.rawValue)")
                 }.foregroundStyle(

+ 1 - 1
FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift

@@ -85,7 +85,7 @@ struct CurrentGlucoseView: View {
                     HStack {
                         if let glucoseValue = combinedGlucoseValues.first?.glucose {
                             let displayGlucose = units == .mgdL ? Decimal(glucoseValue).description : Decimal(glucoseValue)
-                                .asMmolL.formattedAsMmolL
+                                .formattedAsMmolL
                             Text(
                                 glucoseValue == 400 ? "HIGH" : displayGlucose
                             )