Skip to content

Commit

Permalink
Merge pull request NordicSemiconductor#13 from andreikaralkou/patch-2
Browse files Browse the repository at this point in the history
Fixed bug with conversion of temperature unit
  • Loading branch information
philips77 committed Dec 15, 2015
2 parents 7425fc3 + a55d6af commit fc9287e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ private double decodeTemperature(byte[] data) throws Exception {

/*
* Conversion of temperature unit from Fahrenheit to Celsius if unit is in Fahrenheit
* Celsius = (98.6*Fahrenheit -32) 5/9
* Celsius = (Fahrenheit -32) 5/9
*/
if ((flag & FIRST_BIT_MASK) != 0) {
temperatureValue = (float) ((98.6 * temperatureValue - 32) * (5 / 9.0));
temperatureValue = (float) ((temperatureValue - 32) * (5 / 9.0));
}
return temperatureValue;
}
Expand Down

0 comments on commit fc9287e

Please sign in to comment.