Community
Participate
Working Groups
Conversions between METRE and KILOMETRE end up with a RationalConverter where a MultiplyConverter would be more appropriate. See forum entry. Either RationalConverter needs improvement when handling BigDecimal values, or a MultiplyConverter (for Double/BigDecimal type floating values) should be used.
Test snippet to reproduce, will go into test case or example code: --- LengthAmount x = new LengthAmount(1.0001, SI.Prefix.KILO(SI.METRE)); IMeasure<Length> xi = x.to(SI.METRE); System.out.println("x="+x+" xi="+xi); // Results in: x=1.0001 km xi=1000.0 m ...
Fixed by treating Decimal numbers differently from Integer type numbers in BaseAmount when using RationalConverter