List of utility methods to do BigDecimal Divide
BigDecimal | decimalDivide(BigDecimal cs, BigDecimal bcs, int scale) decimal Divide return cs.divide(bcs, scale, BigDecimal.ROUND_HALF_UP);
|
BigDecimal | div(BigDecimal b1, BigDecimal b2) Divide @param v1 with @param v2 return div(b1, b2, DEF_DIV_SCALE);
|
BigDecimal | div(BigDecimal d1, BigDecimal d2) div return div(d1, d2, DEF_DIV_SCALE);
|
BigDecimal | div(BigDecimal v1, BigDecimal v2) div return div(v1, v2, DEF_DIV_SCALE);
|
BigDecimal | div(BigDecimal val, long divisor) div return div(val, bd(divisor)); |
BigDecimal | divide(BigDecimal a, BigDecimal b) divide return a.divide(b, scale, RoundingMode.HALF_UP);
|
BigDecimal | divide(BigDecimal amount, BigDecimal divisor) divide return roundBigDecimal(amount.divide(divisor, 2, RoundingMode.HALF_UP));
|
BigDecimal | divide(BigDecimal aValue1, BigDecimal aValue2, int scale) divide if (aValue1 == null || aValue2 == null) return null; return aValue1.divide(aValue2, scale, BigDecimal.ROUND_HALF_UP); |
BigDecimal | divide(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); |
BigDecimal | divide(BigDecimal dividend, BigDecimal divisor) divide requireNonNull(dividend);
requireNonNull(divisor);
return dividend.divide(divisor, 4, RoundingMode.HALF_DOWN);
|