fix displaying target in mmol

This commit is contained in:
Milos Kozak 2017-08-18 11:46:04 +02:00
parent 4f54b7ba81
commit 6b8dd5868d

View file

@ -393,8 +393,9 @@ public class Profile {
else return DecimalFormatter.to1Decimal(valueInMmol); else return DecimalFormatter.to1Decimal(valueInMmol);
} }
// targets are stored in mg/dl
public static String toTargetRangeString(double low, double high, String units) { public static String toTargetRangeString(double low, double high, String units) {
if (low == high) return toUnitsString(low, low, units); if (low == high) return toUnitsString(low, Profile.fromMgdlToUnits(low, Constants.MMOL), units);
else return toUnitsString(low, low, units) + " - " + toUnitsString(high, high, units); else return toUnitsString(low, Profile.fromMgdlToUnits(low, Constants.MMOL), units) + " - " + toUnitsString(high, Profile.fromMgdlToUnits(high, Constants.MMOL), units);
} }
} }