From 65ddf5ced5a52db150da688ba1a65c84bbcd197c Mon Sep 17 00:00:00 2001 From: PoweRGbg Date: Thu, 1 Mar 2018 18:31:29 +0200 Subject: [PATCH] format using the Profile class method and Constants --- .../plugins/Overview/Dialogs/NewInsulinDialog.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java index dcb457aa35..3c57346c39 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java @@ -249,14 +249,14 @@ public class NewInsulinDialog extends DialogFragment implements OnClickListener, Profile currentProfile = MainApp.getConfigBuilder().getProfile(); if(currentProfile.equals(null)) return; - if(currentProfile.getUnits().equals("mmol")) { - tt = prefTT > 0 ? prefTT*18 : 80d; + if(currentProfile.getUnits().equals(Constants.MMOL)) { + tt = prefTT > 0 ? Profile.toMgdl(prefTT, Constants.MGDL) : 80d; } else tt = prefTT > 0 ? prefTT : 80d; final double finalTT = tt; if (startESMCheckbox.isChecked()) { if(currentProfile.getUnits().equals("mmol")){ - confirmMessage += "
" + "TT: " + "" + tt/18 + "mmol for " + ((int) ttDuration) + " min "; + confirmMessage += "
" + "TT: " + "" + Profile.toMmol(tt, Constants.MMOL) + "mmol for " + ((int) ttDuration) + " min "; } else confirmMessage += "
" + "TT: " + "" + ((int) tt) + "mg/dl for " + ((int) ttDuration) + " min "; }