propper conversion from MMOL to MgDl

This commit is contained in:
Roumen Georgiev 2018-03-02 16:33:53 +02:00
parent 6c75b1b317
commit ea29b6ad82
2 changed files with 3 additions and 3 deletions

View file

@ -261,8 +261,8 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, D
if(currentProfile == null)
return;
if(currentProfile.getUnits().equals(Constants.MMOL)) {
esTT = eatingSoonTT > 0 ? Profile.toMgdl(eatingSoonTT,Constants.MGDL) : 90d;
activityTT = prefTT > 0 ? Profile.toMgdl(prefTT,Constants.MGDL) : 140d;
esTT = eatingSoonTT > 0 ? Profile.toMgdl(eatingSoonTT,Constants.MMOL) : 90d;
activityTT = prefTT > 0 ? Profile.toMgdl(prefTT,Constants.MMOL) : 140d;
} else {
esTT = eatingSoonTT > 0 ? eatingSoonTT : 90d;
activityTT = prefTT > 0 ? prefTT : 140d;

View file

@ -250,7 +250,7 @@ public class NewInsulinDialog extends DialogFragment implements OnClickListener,
if(currentProfile == null)
return;
if(currentProfile.getUnits().equals(Constants.MMOL))
tt = prefTT > 0 ? Profile.toMgdl(prefTT, Constants.MGDL) : 80d;
tt = prefTT > 0 ? Profile.toMgdl(prefTT, Constants.MMOL) : 80d;
else
tt = prefTT > 0 ? prefTT : 80d;
final double finalTT = tt;