From 80124e6d7b6620fd633f9b0e7ed3c724c201d278 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Fri, 14 Jul 2017 16:45:31 +0200 Subject: [PATCH] Bolus wizard: use PumpDescription to round final bolus to a value compatible with the pump. --- app/src/main/java/info/nightscout/utils/BolusWizard.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/utils/BolusWizard.java b/app/src/main/java/info/nightscout/utils/BolusWizard.java index 94b19d2b9b..e5af535759 100644 --- a/app/src/main/java/info/nightscout/utils/BolusWizard.java +++ b/app/src/main/java/info/nightscout/utils/BolusWizard.java @@ -110,7 +110,8 @@ public class BolusWizard { calculatedTotalInsulin = 0d; } - calculatedTotalInsulin = Round.roundTo(calculatedTotalInsulin, 0.05d); + double bolusStep = MainApp.getConfigBuilder().getPumpDescription().bolusStep; + calculatedTotalInsulin = Round.roundTo(calculatedTotalInsulin, bolusStep); return calculatedTotalInsulin; }