Skip to content

Commit f68fc0e

Browse files
authored
added decimal format for mmol users
1 parent 2ec8afb commit f68fc0e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Loop/Managers/NightscoutDataManager.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,13 @@ final class NightscoutDataManager {
161161
}
162162

163163
if let loopEventualBGquantity = predictedGlucose?.last?.quantity, let userUnit = deviceDataManager.loopManager.settings.glucoseTargetRangeSchedule?.unit {
164-
loopEventualBG = String(Int(loopEventualBGquantity.doubleValue(for: userUnit)))
164+
if userUnit == HKUnit.milligramsPerDeciliter() {
165+
loopEventualBG = String(Int(loopEventualBGquantity.doubleValue(for: userUnit)))
166+
}
167+
else
168+
{
169+
loopEventualBG = String(format:"%.1f",loopEventualBGquantity.doubleValue(for: userUnit))
170+
}
165171
}
166172
else
167173
{

0 commit comments

Comments
 (0)