@@ -20,20 +20,6 @@ struct ForecastChart: View {
2020 ) ) // min is 1.5h -> (1.5*1h = 1.5*(5*12*60))
2121 }
2222
23- private var glucoseFormatter : NumberFormatter {
24- let formatter = NumberFormatter ( )
25- formatter. numberStyle = . decimal
26-
27- if state. units == . mmolL {
28- formatter. maximumFractionDigits = 1
29- formatter. minimumFractionDigits = 1
30- formatter. roundingMode = . halfUp
31- } else {
32- formatter. maximumFractionDigits = 0
33- }
34- return formatter
35- }
36-
3723 private var selectedGlucose : GlucoseStored ? {
3824 guard let selection = selection else { return nil }
3925 let range = selection. addingTimeInterval ( - 150 ) ... selection. addingTimeInterval ( 150 )
@@ -73,8 +59,11 @@ struct ForecastChart: View {
7359
7460 HStack {
7561 Image ( systemName: " syringe.fill " )
76- Text ( " \( state. amount. description) U " )
62+ Text (
63+ " \( Formatter . bolusFormatter. string ( from: state. amount as NSNumber ) ?? state. amount. description) "
64+ ) + Text( String ( localized: " U " , comment: " Insulin unit " ) )
7765 }
66+
7867 . font ( . footnote)
7968 . foregroundStyle ( . blue)
8069 . padding ( 8 )
@@ -185,19 +174,19 @@ struct ForecastChart: View {
185174 HStack ( spacing: 10 ) {
186175 HStack ( spacing: 4 ) {
187176 Image ( systemName: " circle.fill " ) . foregroundStyle ( Color . insulin)
188- Text ( " IOB " ) . foregroundStyle ( Color . secondary)
177+ Text ( String ( localized : " IOB " ) ) . foregroundStyle ( Color . secondary)
189178 }
190179 HStack ( spacing: 4 ) {
191180 Image ( systemName: " circle.fill " ) . foregroundStyle ( Color . uam)
192- Text ( " UAM " ) . foregroundStyle ( Color . secondary)
181+ Text ( String ( localized : " UAM " ) ) . foregroundStyle ( Color . secondary)
193182 }
194183 HStack ( spacing: 4 ) {
195184 Image ( systemName: " circle.fill " ) . foregroundStyle ( Color . zt)
196- Text ( " ZT " ) . foregroundStyle ( Color . secondary)
185+ Text ( String ( localized : " ZT " ) ) . foregroundStyle ( Color . secondary)
197186 }
198187 HStack ( spacing: 4 ) {
199188 Image ( systemName: " circle.fill " ) . foregroundStyle ( Color . orange)
200- Text ( " COB " ) . foregroundStyle ( Color . secondary)
189+ Text ( String ( localized : " COB " ) ) . foregroundStyle ( Color . secondary)
201190 }
202191 } . font ( . caption2)
203192 }
0 commit comments