Java Utililty Methods BigDecimal Divide

List of utility methods to do BigDecimal Divide

Description

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

Method

BigDecimaldecimalDivide(BigDecimal cs, BigDecimal bcs, int scale)
decimal Divide
return cs.divide(bcs, scale, BigDecimal.ROUND_HALF_UP);
BigDecimaldiv(BigDecimal b1, BigDecimal b2)
Divide @param v1 with @param v2
return div(b1, b2, DEF_DIV_SCALE);
BigDecimaldiv(BigDecimal d1, BigDecimal d2)
div
return div(d1, d2, DEF_DIV_SCALE);
BigDecimaldiv(BigDecimal v1, BigDecimal v2)
div
return div(v1, v2, DEF_DIV_SCALE);
BigDecimaldiv(BigDecimal val, long divisor)
div
return div(val, bd(divisor));
BigDecimaldivide(BigDecimal a, BigDecimal b)
divide
return a.divide(b, scale, RoundingMode.HALF_UP);
BigDecimaldivide(BigDecimal amount, BigDecimal divisor)
divide
return roundBigDecimal(amount.divide(divisor, 2, RoundingMode.HALF_UP));
BigDecimaldivide(BigDecimal aValue1, BigDecimal aValue2, int scale)
divide
if (aValue1 == null || aValue2 == null)
    return null;
return aValue1.divide(aValue2, scale, BigDecimal.ROUND_HALF_UP);
BigDecimaldivide(BigDecimal bd1, BigDecimal bd2)
divide
if (bd1.compareTo(new BigDecimal(0)) == 0)
    return (new BigDecimal(0));
if (bd2.compareTo(new BigDecimal(0)) == 0)
    return (null);
BigDecimal result = bd1.divide(bd2, 2, BigDecimal.ROUND_HALF_UP);
return (result);
BigDecimaldivide(BigDecimal dividend, BigDecimal divisor)
divide
requireNonNull(dividend);
requireNonNull(divisor);
return dividend.divide(divisor, 4, RoundingMode.HALF_DOWN);