Ensure basal rate shown as a percentage if required according to user preferences.

This commit is contained in:
Andrew Warrington 2017-12-21 09:50:16 +01:00
parent b180569695
commit 176c5f46ff

View file

@ -639,10 +639,14 @@ public class WatchUpdaterService extends WearableListenerService implements
String basalStringResult; String basalStringResult;
TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis()); TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis());
if (activeTemp != null) { if (activeTemp != null) {
basalStringResult = activeTemp.toStringVeryShort(); basalStringResult = activeTemp.toStringShort();
} else {
if (SP.getBoolean(R.string.key_danar_visualizeextendedaspercentage, false)) {
basalStringResult = "100%";
} else { } else {
basalStringResult = DecimalFormatter.to2Decimal(MainApp.getConfigBuilder().getProfile().getBasal()) + "U/h"; basalStringResult = DecimalFormatter.to2Decimal(MainApp.getConfigBuilder().getProfile().getBasal()) + "U/h";
} }
}
return basalStringResult; return basalStringResult;
} }