diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java
index 1d028bf051..1508b003f5 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java
@@ -248,23 +248,23 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, D
Profile currentProfile = MainApp.getConfigBuilder().getProfile();
if(currentProfile.equals(null))
return;
- if(currentProfile.getUnits().equals("mmol")) {
- esTT = eatingSoonTT > 0 ? eatingSoonTT*18 : 90d;
- tt = prefTT > 0 ? prefTT*18 : 140d;
+ if(currentProfile.getUnits().equals(Constants.MMOL)) {
+ esTT = eatingSoonTT > 0 ? eatingSoonTT*Constants.MMOLL_TO_MGDL : 90d;
+ tt = prefTT > 0 ? prefTT*Constants.MMOLL_TO_MGDL : 140d;
} else
esTT = eatingSoonTT > 0 ? eatingSoonTT : 90d;
tt = prefTT > 0 ? prefTT : 140d;
if (startActivityTTCheckbox.isChecked() ||(startActivityTTCheckbox.isChecked() && ESMCheckbox.isChecked()) ) {
- if(currentProfile.getUnits().equals("mmol")) {
- confirmMessage += "
" + "TT: " + "" + tt/18 + " mmol/l for " + ((int) ttDuration) + " min ";
+ if(currentProfile.getUnits().equals(Constants.MMOL)) {
+ confirmMessage += "
" + "TT: " + "" + Profile.toMmol(tt,Constants.MGDL) + " mmol/l for " + ((int) ttDuration) + " min ";
} else
confirmMessage += "
" + "TT: " + "" + ((int) tt) + " mg/dl for " + ((int) ttDuration) + " min ";
}else if (ESMCheckbox.isChecked()) {
- if(currentProfile.getUnits().equals("mmol")) {
- confirmMessage += "
" + "TT: " + "" + esTT/18 + " mmol/l for " + ((int) esDuration) + " min ";
+ if(currentProfile.getUnits().equals(Constants.MMOL)) {
+ confirmMessage += "
" + "TT: " + "" + Profile.toMmol(esTT,Constants.MGDL) + " mmol/l for " + ((int) esDuration) + " min ";
} else
confirmMessage += "
" + "TT: " + "" + ((int) esTT) + " mg/dl for " + ((int) esDuration) + " min ";