List of utility methods to do BigDecimal Add
BigDecimal | sum(BigDecimal num1, BigDecimal num2, int scale) sum return roundBigDecimal(num1.add(num2), scale);
|
BigDecimal | sum(BigDecimal[] bigDecimalNumbers) sum BigDecimal sum = new BigDecimal(0); for (BigDecimal number : bigDecimalNumbers) { if (number != null) { sum = sum.add(number); return sum; |
BigDecimal | sum(final List sum BigDecimal total = BigDecimal.ZERO; for (final BigDecimal item : list) { total = total.add(item); return total; |
BigDecimal | sum(List Returns the sum number in the numbers list. BigDecimal sum = new BigDecimal(0); for (BigDecimal bigDecimal : numbers) { sum = sum.add(bigDecimal); return sum; |
BigDecimal | sumBig(final Collection extends BigDecimal> values) sum Big final BigDecimal result = BigDecimal.ZERO; for (final BigDecimal n : values) { result.add(n); return result; |
BigDecimal | sumBigDecimal(List sum Big Decimal BigDecimal sum = BigDecimal.ZERO; for (Double val : vector) { sum = sum.add(BigDecimal.valueOf(val)); return sum; |
Map | sumCurrencyMap(Map 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 { ... |