BolusWizard use 0 for insulin correction if in range

This commit is contained in:
Milos Kozak 2017-12-22 00:17:46 +01:00
parent 771f9eac1a
commit a5c4495a5d

View file

@ -71,7 +71,9 @@ public class BolusWizard {
targetBGLow = Profile.fromMgdlToUnits(tempTarget.low, specificProfile.getUnits());
targetBGHigh = Profile.fromMgdlToUnits(tempTarget.high, specificProfile.getUnits());
}
if (bg <= targetBGLow) {
if (bg >= targetBGLow && bg <= targetBGHigh) {
bgDiff = 0d;
} else if (bg <= targetBGLow) {
bgDiff = bg - targetBGLow;
} else {
bgDiff = bg - targetBGHigh;