Skip to content

Commit dd5e27a

Browse files
committed
Added decimal to Celsius display
The conversion from F to C was rounding off the decimal when showing Celsius temperatures. Adjusted the code to show a single decimal.
1 parent 8c0c4bc commit dd5e27a

File tree

7 files changed

+2
-1
lines changed

7 files changed

+2
-1
lines changed
8 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.
10 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

com.androidthermostat.client/src/com/androidthermostat/client/data/Conditions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ public String getDisplayInsideTemperature() {
5050
if (Settings.getCurrent().displayCelsius)
5151
{
5252
if (insideTemperature==0) return "0° C";
53-
else return String.valueOf( Math.round(Utils.fahrenheitToCelsius(insideTemperature)) ) + "° C";
53+
else return String.valueOf( Math.round(Utils.fahrenheitToCelsius(insideTemperature)*10.0) / 10.0 ) + "° C";
54+
//else return String.format("%.1g%n", Math.round(Utils.fahrenheitToCelsius(insideTemperature))) + "° C";
5455
} else {
5556
return String.valueOf(insideTemperature) + "° F";
5657
}
11 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)