Merge PR #688: More smaller fixes in energy views

This commit is contained in:
Jenkins nymea 2021-10-01 17:50:34 +02:00
commit a7c53a443b
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ ThingPageBase {
Label {
font: Style.largeFont
text: "%1 %2".arg(root.maxChargingCurrentState.value).arg(Types.toUiUnit(root.maxChargingCurrentStateType.unit))
text: "%1 %2".arg(root.maxChargingCurrentState.value.toFixed(1)).arg(Types.toUiUnit(root.maxChargingCurrentStateType.unit))
width: parent.width
horizontalAlignment: Text.AlignHCenter
}

View File

@ -138,7 +138,7 @@ ThingPageBase {
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
font: Style.largeFont
property bool toKilos: currentPower >= 1000
property bool toKilos: Math.abs(currentPower) >= 1000
property double value: Math.abs(currentPower / (toKilos ? 1000 : 1))
text: "%1 %2".arg(value.toFixed(toKilos ? 2 : 1)).arg(toKilos ? "kW" : "W")
}