mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-23 16:53:04 +02:00
Inlife: use doubles when doing the calculations
This commit is contained in:
@@ -185,10 +185,10 @@ public class BluetoothInlife extends BluetoothCommunication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float fatKg = weight - lbm;
|
float fatKg = weight - lbm;
|
||||||
float fat = (fatKg / weight) * 100.0f;
|
double fat = (fatKg / weight) * 100.0;
|
||||||
float water = (0.73f * (weight - fatKg) / weight) * 100.0f;
|
double water = (0.73f * (weight - fatKg) / weight) * 100.0;
|
||||||
float muscle = (0.548f * lbm / weight) * 100.0f;
|
double muscle = (0.548 * lbm / weight) * 100.0;
|
||||||
float bone = 0.05158f * lbm;
|
double bone = 0.05158 * lbm;
|
||||||
|
|
||||||
double visceral;
|
double visceral;
|
||||||
final float height = selectedUser.getBodyHeight();
|
final float height = selectedUser.getBodyHeight();
|
||||||
@@ -221,10 +221,10 @@ public class BluetoothInlife extends BluetoothCommunication {
|
|||||||
|
|
||||||
ScaleMeasurement measurement = new ScaleMeasurement();
|
ScaleMeasurement measurement = new ScaleMeasurement();
|
||||||
measurement.setWeight(weight);
|
measurement.setWeight(weight);
|
||||||
measurement.setFat(fat);
|
measurement.setFat((float) fat);
|
||||||
measurement.setWater(water);
|
measurement.setWater((float) water);
|
||||||
measurement.setMuscle(muscle);
|
measurement.setMuscle((float) muscle);
|
||||||
measurement.setBone(bone);
|
measurement.setBone((float) bone);
|
||||||
measurement.setLbm(lbm);
|
measurement.setLbm(lbm);
|
||||||
measurement.setVisceralFat((float) visceral);
|
measurement.setVisceralFat((float) visceral);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user