This seems like a mistake . But it is fixed in Java 8 . Direct URL to fix .
There is a workaround for this:
BigDecimal zero = BigDecimal.ZERO; if (someBigDecimal.compareTo(zero) == 0) { someBigDecimal = zero; } else { someBigDecimal = someBigDecimal.stripTrailingZeros(); }
Refer to this link .
Also a good point from Holger in the comments
Do not waste resources on creating your own zero instance. Use BigDecimal.ZERO .
source share