diff --git a/application/qml/pages/MainPage.qml b/application/qml/pages/MainPage.qml index 54121c6..0f6c833 100644 --- a/application/qml/pages/MainPage.qml +++ b/application/qml/pages/MainPage.qml @@ -180,7 +180,14 @@ Page { } MyDetailItem { label: qsTr("Temperature:") - value: (Qt.locale().measurementSystem == Locale.ImperialUSSystem) ? Math.floor((battery.temperature / 10) * 1.8 + 32) + " F" : Math.floor(battery.temperature / 10) + " °C" + value: battery.temperature === 0x7FFFFFFF ? healthText["unknown"] : formatTemperature(battery.temperature) + + function formatTemperature(temp) { + if(Qt.locale().measurementSystem === Locale.ImperialUSSystem) { + return Math.floor((battery.temperature / 10) * 1.8 + 32) + " °F" + } + return Math.floor(battery.temperature / 10) + " °C" + } } } }