Skip to content

Commit

Permalink
use BigDecimal in comparison
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Herwege <[email protected]>
  • Loading branch information
mherwege committed Jan 20, 2025
1 parent 266add0 commit 61ef3f2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private int internalCompareTo(QuantityType<?> o) {
QuantityType<T> v1 = this.toUnit(getUnit().getSystemUnit());
QuantityType<?> v2 = o.toUnit(o.getUnit().getSystemUnit());
if (v1 != null && v2 != null) {
return Double.compare(v1.doubleValue(), v2.doubleValue());
return v1.toBigDecimal().compareTo(v2.toBigDecimal());
} else {
throw new IllegalArgumentException("Unable to convert to system unit during compare.");
}
Expand Down

0 comments on commit 61ef3f2

Please sign in to comment.