List of utility methods to do BigDecimal Add
BigDecimal | add(BigDecimal value1, BigDecimal value2) add if (value1 != null && value2 != null) { return value1.add(value2); if (value1 != null) { return value1; if (value2 != null) { return value2; ... |
BigDecimal | add(BigDecimal... operands) Returns the sum of all the given decimals. BigDecimal result = null; if (operands != null) { for (BigDecimal operand : operands) { if (operand != null) { if (result == null) { result = operand; } else { result = result.add(operand); ... |
BigDecimal[] | add(BigDecimal[] item1, BigDecimal[] item2) add for (int i = 0; i < item1.length; i++) { item1[i] = item1[i].add(item2[i]); return item1; |
BigDecimal | add(final BigDecimal baseAmount, final BigDecimal amountToAdd) Adds two amounts rounding to two decimal places. return rounded(baseAmount).add(rounded(amountToAdd));
|
BigDecimal | add(final BigDecimal start, final BigDecimal... values) Add n BigDecimal safely (i.e. BigDecimal total = start != null ? start : BigDecimal.ZERO; if (values != null) { for (final BigDecimal v : values) { total = doAdd(total, v); return total; |
BigDecimal | add(final BigDecimal v1, final BigDecimal v2) add if (v1 == null) { if (v2 == null) { return BigDecimal.ZERO; } else { return v2; } else { if (v2 == null) { ... |
Vector | add(Vector add int m = a.size(); Vector<BigDecimal> c = new Vector(m); for (int i = 0; i < m; i++) { BigDecimal value = ((BigDecimal) a.elementAt(i)).add((BigDecimal) b.elementAt(i)); c.add(value); return c; |
BigDecimal | add2Abs(BigDecimal aValue1, BigDecimal aValue2) add Abs if (aValue1 == null || aValue2 == null) return null; return aValue1.add(aValue2).abs(); |
BigDecimal | addBigDec(BigDecimal b1, BigDecimal b2) add Big Dec return b1.add(b2);
|
BigDecimal | addBigDecimal(BigDecimal a, BigDecimal b) add Big Decimal if (a == null) { return b; } else if (b == null) { return a; } else { return a.add(b); |