Java Utililty Methods BigDecimal Ceiling

List of utility methods to do BigDecimal Ceiling

Description

The list of methods to do BigDecimal Ceiling are organized into topic(s).

Method

BigIntegerceil(BigDecimal x)
ceil
return x.setScale(0, RoundingMode.CEILING).unscaledValue();
BigDecimalceiling(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;
BigDecimalceiling1(BigDecimal number)
ceiling
return number.setScale(0, RoundingMode.CEILING);