List of utility methods to do BigDecimal Ceiling
BigInteger | ceil(BigDecimal x) ceil return x.setScale(0, RoundingMode.CEILING).unscaledValue();
|
BigDecimal | ceiling(BigDecimal dividend, int divisor) ceiling BigDecimal denominator = BigDecimal.valueOf(divisor); if (dividend == null || divisor == 0 || dividend.remainder(denominator).equals(BigDecimal.ZERO)) { return dividend; BigDecimal factor = dividend.divideToIntegralValue(denominator).add(BigDecimal.ONE); BigDecimal product = factor.multiply(denominator); return product; |
BigDecimal | ceiling1(BigDecimal number) ceiling return number.setScale(0, RoundingMode.CEILING);
|