newMeasurement.setValue(
((value
// convert to the base unit
* unit.getMultiplier().getMultiplier() + unit.getMultiplier().getOffset())
// convert the base unit to the new unit
- newUnit.getMultiplier().getOffset()) / newUnit.getMultiplier().getMultiplier()
);
Currently unit conversion is calculated by
This leads to some problem, e.g. 20°C would be -300°F and not 68°F.
Calculation should be adjusted to the following way:
https://github.com/qudt/qudt-public-repo/wiki/Support-for-measures-of-absolute-values-and-for-intervals-(differences)#converting-units-on-linear-scales