From 6b8dd5868d242270f15bac41c5314ac3fe2cbd84 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 18 Aug 2017 11:46:04 +0200 Subject: [PATCH] fix displaying target in mmol --- .../main/java/info/nightscout/androidaps/data/Profile.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/data/Profile.java b/app/src/main/java/info/nightscout/androidaps/data/Profile.java index 85b8355bf5..ac7cc0edd0 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/Profile.java +++ b/app/src/main/java/info/nightscout/androidaps/data/Profile.java @@ -393,8 +393,9 @@ public class Profile { else return DecimalFormatter.to1Decimal(valueInMmol); } + // targets are stored in mg/dl public static String toTargetRangeString(double low, double high, String units) { - if (low == high) return toUnitsString(low, low, units); - else return toUnitsString(low, low, units) + " - " + toUnitsString(high, high, units); + if (low == high) return toUnitsString(low, Profile.fromMgdlToUnits(low, Constants.MMOL), units); + else return toUnitsString(low, Profile.fromMgdlToUnits(low, Constants.MMOL), units) + " - " + toUnitsString(high, Profile.fromMgdlToUnits(high, Constants.MMOL), units); } }