java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result
do this:
RoundingMode DEFAULT_ROUNDING_MODE = RoundingMode.HALF_UP;
int DIVIDE_SCALE = 10;
BigDecimal op1, op2
...
BigDecimal result = op1.divide(op2, DIVIDE_SCALE, DEFAULT_ROUNDING_MODE);
and you will be happy.
Wednesday, March 30, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment