Java Utililty Methods BigDecimal Subtract

List of utility methods to do BigDecimal Subtract

Description

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

Method

BigDecimalsubtract(BigDecimal minuend, BigDecimal subtrahend)
Subtracts one decimal from another returning the result.
BigDecimal result = null;
if (minuend != null && subtrahend != null) {
    result = minuend.subtract(subtrahend);
return result;
BigDecimalsubtract(BigDecimal num1, BigDecimal num2)
subtract
if (null == num1 || null == num2) {
    return ZERO;
BigDecimal temp = num1.subtract(num2);
return temp.setScale(STANDARD_SCALE, STANDARD_ROUND_HALF);
BigDecimalsubtract(BigDecimal number1, BigDecimal number2, int decimalPlaces)
subtract
return number1.subtract(number2, mathContext).setScale(decimalPlaces, roundingMode);
BigDecimalsubtract(BigDecimal one, BigDecimal another)
subtract
return one.subtract(another);
BigDecimalsubtract(BigDecimal v1, BigDecimal v2)
subtract
return v1.subtract(v2);
BigDecimalsubtract(final BigDecimal baseAmount, final BigDecimal amountToSubtract)
Subtract one amount from another rounding to two decimal places.
return rounded(baseAmount).subtract(rounded(amountToSubtract));
BigDecimalsubtract(final BigDecimal start, final BigDecimal... values)
Subtract n BigDecimal safely (i.e.
BigDecimal total = start != null ? start : BigDecimal.ZERO;
if (values != null) {
    for (final BigDecimal v : values) {
        total = doSubtract(total, v);
return total;
BigDecimalsubtract(float a, BigDecimal b_bd)
Convert the float parameter into BigDecimal, subtract and return BigDecimal
BigDecimal a_bd = new BigDecimal(Float.toString(a));
return a_bd.subtract(b_bd);
Vectorsubtract(Vector a, Vector b)
subtract
int m = a.size();
Vector<BigDecimal> c = new Vector(m);
for (int i = 0; i < m; i++) {
    BigDecimal value = ((BigDecimal) a.elementAt(i)).subtract((BigDecimal) b.elementAt(i));
    c.add(value);
return c;
BigDecimalsubtract2Abs(BigDecimal aValue1, BigDecimal aValue2)
subtract Abs
if (aValue1 == null || aValue2 == null)
    return null;
return aValue1.subtract(aValue2).abs();