List of utility methods to do BigDecimal Subtract
BigDecimal | sub(BigDecimal b1, BigDecimal b2) Substract @param b1 with @param b2 if (b1 == null && b2 == null) { return null; if (b1 == null) { b1 = new BigDecimal(0); if (b2 == null) { b2 = new BigDecimal(0); ... |
BigDecimal | sub(BigDecimal d1, BigDecimal d2) sub return d1.subtract(d2);
|
BigDecimal | sub(BigDecimal v1, BigDecimal v2) sub v1 = v1 == null ? BigDecimal.ZERO : v1;
v2 = v2 == null ? BigDecimal.ZERO : v2;
return v1.subtract(v2);
|
BigDecimal | sub(BigDecimal v1, BigDecimal v2) sub BigDecimal b1 = new BigDecimal("0"); if (v1 != null) { b1 = new BigDecimal(Double.toString(v1.doubleValue())); BigDecimal b2 = new BigDecimal("0"); if (v2 != null) { b2 = new BigDecimal(Double.toString(v2.doubleValue())); return b1.subtract(b2); |
BigDecimal | subtract(BigDecimal a, BigDecimal b) subtract if (a == null) a = new BigDecimal("0.00"); if (b == null) b = new BigDecimal("0.00"); return a.subtract(b).setScale(2); |
BigDecimal | subtract(BigDecimal a, BigDecimal b) subtract return a.subtract(b).setScale(scale, RoundingMode.HALF_UP);
|
BigDecimal | subtract(BigDecimal amount, BigDecimal subtrahend, int scale) subtract return roundBigDecimal(amount.subtract(subtrahend), scale);
|
BigDecimal | subtract(BigDecimal aValue1, BigDecimal aValue2) subtract if (aValue1 == null || aValue2 == null) return null; return aValue1.subtract(aValue2); |
BigDecimal | subtract(BigDecimal bigDecimal, BigDecimal bigDecimal2) subtract if (bigDecimal == null && bigDecimal2 == null) { return zeroBigDecimal(); if (bigDecimal == null) { return bigDecimal2; if (bigDecimal2 == null) { return bigDecimal; ... |
BigDecimal | subtract(BigDecimal left, BigDecimal right) subtract try { return left.subtract(right, MathContext.UNLIMITED); } catch (ArithmeticException ex) { return left.subtract(right, MathContext.DECIMAL128); |