mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2025-12-22 17:04:23 +01:00
Merge pull request #13 from andreikaralkou/patch-2
Fixed bug with conversion of temperature unit
This commit is contained in:
@@ -122,10 +122,10 @@ public class HTSManager extends BleManager<HTSManagerCallbacks> {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Conversion of temperature unit from Fahrenheit to Celsius if unit is in Fahrenheit
|
* 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) {
|
if ((flag & FIRST_BIT_MASK) != 0) {
|
||||||
temperatureValue = (float) ((98.6 * temperatureValue - 32) * (5 / 9.0));
|
temperatureValue = (float) ((temperatureValue - 32) * (5 / 9.0));
|
||||||
}
|
}
|
||||||
return temperatureValue;
|
return temperatureValue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user