As Adrian asked .... Profile.toMgDl()

This commit is contained in:
Roumen Georgiev 2018-03-02 15:09:03 +02:00
parent f3a12be0be
commit e923bf2156

View file

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