Skip to content

Commit a55d6af

Browse files
Fixed bug with conversion of temperature unit
1 parent 7425fc3 commit a55d6af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/no/nordicsemi/android/nrftoolbox/hts/HTSManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ private double decodeTemperature(byte[] data) throws Exception {
122122

123123
/*
124124
* Conversion of temperature unit from Fahrenheit to Celsius if unit is in Fahrenheit
125-
* Celsius = (98.6*Fahrenheit -32) 5/9
125+
* Celsius = (Fahrenheit -32) 5/9
126126
*/
127127
if ((flag & FIRST_BIT_MASK) != 0) {
128-
temperatureValue = (float) ((98.6 * temperatureValue - 32) * (5 / 9.0));
128+
temperatureValue = (float) ((temperatureValue - 32) * (5 / 9.0));
129129
}
130130
return temperatureValue;
131131
}

0 commit comments

Comments
 (0)