Skip to content

Commit 8f6efe7

Browse files
authored
[LOOP-4464] only round bolus volumes down (#543)
* only round bolus volumes down * let the pumpManager round bolus volumes
1 parent 8237f3a commit 8f6efe7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Loop/Managers/DeviceDataManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ extension DeviceDataManager: LoopDataManagerDelegate {
12761276
return units
12771277
}
12781278

1279-
let rounded = ([0.0] + pumpManager.supportedBolusVolumes).enumerated().min( by: { abs($0.1 - units) < abs($1.1 - units) } )!.1
1279+
let rounded = pumpManager.roundToSupportedBolusVolume(units: units)
12801280
self.log.default("Rounded %{public}@ to %{public}@", String(describing: units), String(describing: rounded))
12811281

12821282
return rounded

0 commit comments

Comments
 (0)