Java Utililty Methods BigDecimal Add

List of utility methods to do BigDecimal Add

Description

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

Method

BigDecimalsum(BigDecimal num1, BigDecimal num2, int scale)
sum
return roundBigDecimal(num1.add(num2), scale);
BigDecimalsum(BigDecimal[] bigDecimalNumbers)
sum
BigDecimal sum = new BigDecimal(0);
for (BigDecimal number : bigDecimalNumbers) {
    if (number != null) {
        sum = sum.add(number);
return sum;
BigDecimalsum(final List list)
sum
BigDecimal total = BigDecimal.ZERO;
for (final BigDecimal item : list) {
    total = total.add(item);
return total;
BigDecimalsum(List numbers)
Returns the sum number in the numbers list.
BigDecimal sum = new BigDecimal(0);
for (BigDecimal bigDecimal : numbers) {
    sum = sum.add(bigDecimal);
return sum;
BigDecimalsumBig(final Collection values)
sum Big
final BigDecimal result = BigDecimal.ZERO;
for (final BigDecimal n : values) {
    result.add(n);
return result;
BigDecimalsumBigDecimal(List vector)
sum Big Decimal
BigDecimal sum = BigDecimal.ZERO;
for (Double val : vector) {
    sum = sum.add(BigDecimal.valueOf(val));
return sum;
MapsumCurrencyMap(Map> destMap, Map> mapToSum)
sum Currency Map
Map<String, BigDecimal> tagMap = null;
for (String currency : mapToSum.keySet()) {
    if ((tagMap = destMap.get(currency)) != null) {
        for (String tag : mapToSum.get(currency).keySet()) {
            if (tagMap.containsKey(tag)) {
                BigDecimal newAmount = tagMap.get(tag).add(mapToSum.get(currency).get(tag));
                tagMap.put(tag, newAmount);
            } else {
...