support weird US temperature measurement

This commit is contained in:
Peter G. (nephros) 2021-05-02 16:00:00 +02:00
parent 4a535edd59
commit ce994a0d1e

View file

@ -177,9 +177,7 @@ Page {
}
MyDetailItem {
label: qsTr("Temperature:")
// TODO: use weird degrees for US users
//value: useImperial ? celsiusToFahrenheit(battery.temperature) + " F" : Math.floor(battery.temperature / 10) + " °C"
value: Math.floor(battery.temperature / 10) + " °C"
value: (Qt.locale().measurementSystem == Locale.ImperialUSSystem) ? Math.floor((battery.temperature / 10) * 1.8 + 32) + " F" : Math.floor(battery.temperature / 10) + " °C"
}
}
}