From 11b8b83651ed7bb321119d9d58eff47bb374eaae Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Fri, 4 Jan 2019 19:27:44 +0100 Subject: [PATCH] ignore rounding deviations --- .../androidaps/plugins/Wear/ActionStringHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java index 5245921922..eebe7ce4e2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java @@ -232,8 +232,8 @@ public class ActionStringHandler { 0d, percentage, useBolusIOB, useBasalIOB, false, useTrend); Double insulinAfterConstraints = MainApp.getConstraintChecker().applyBolusConstraints(new Constraint<>(bolusWizard.calculatedTotalInsulin)).value(); - if (insulinAfterConstraints - bolusWizard.calculatedTotalInsulin != 0) { - sendError("Insulin contraint violation!" + + if (Math.abs(insulinAfterConstraints - bolusWizard.calculatedTotalInsulin) >= 0.01) { + sendError("Insulin constraint violation!" + "\nCannot deliver " + format.format(bolusWizard.calculatedTotalInsulin) + "!"); return; }