Fix Units in presentation string
This commit is contained in:
parent
f6ecf8a5df
commit
8fe0266bcb
1 changed files with 4 additions and 4 deletions
|
@ -131,13 +131,13 @@ class UserEntryPresentationHelper @Inject constructor(
|
|||
is ValueWithUnit.Timestamp -> dateUtil.dateAndTimeAndSecondsString(valueWithUnit.value)
|
||||
|
||||
is ValueWithUnit.Mgdl -> {
|
||||
if (profileFunction.getUnits() == GlucoseUnit.MGDL) DecimalFormatter.to0Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
|
||||
else DecimalFormatter.to1Decimal(valueWithUnit.value * Constants.MGDL_TO_MMOLL) + translator.translate(valueWithUnit)
|
||||
if (profileFunction.getUnits() == GlucoseUnit.MGDL) DecimalFormatter.to0Decimal(valueWithUnit.value) + rh.gs(R.string.mgdl)
|
||||
else DecimalFormatter.to1Decimal(valueWithUnit.value * Constants.MGDL_TO_MMOLL) + rh.gs(R.string.mmol)
|
||||
}
|
||||
|
||||
is ValueWithUnit.Mmoll -> {
|
||||
if (profileFunction.getUnits() == GlucoseUnit.MMOL) DecimalFormatter.to1Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
|
||||
else DecimalFormatter.to0Decimal(valueWithUnit.value * Constants.MMOLL_TO_MGDL) + translator.translate(valueWithUnit)
|
||||
if (profileFunction.getUnits() == GlucoseUnit.MMOL) DecimalFormatter.to1Decimal(valueWithUnit.value) + rh.gs(R.string.mmol)
|
||||
else DecimalFormatter.to0Decimal(valueWithUnit.value * Constants.MMOLL_TO_MGDL) + rh.gs(R.string.mgdl)
|
||||
}
|
||||
|
||||
ValueWithUnit.UNKNOWN -> ""
|
||||
|
|
Loading…
Reference in a new issue