import org.apache.poi.util.Internal;
import java.math.BigDecimal;
+import java.math.MathContext;
import java.math.RoundingMode;
/**
@Internal
public static double scaledRoundUsingBigDecimal(double xval, double multiplier, RoundingMode mode) {
BigDecimal multiplierDecimal = BigDecimal.valueOf(multiplier);
- BigDecimal bd = BigDecimal.valueOf(xval).divide(multiplierDecimal)
+ BigDecimal bd = BigDecimal.valueOf(xval).divide(multiplierDecimal, MathContext.DECIMAL128)
.setScale(0, mode)
.multiply(multiplierDecimal);
return bd.doubleValue();