List of utility methods to do BigDecimal Add
String | addBigDecimals(String value1, String value2) add Big Decimals BigDecimal result = (new BigDecimal(value1.trim())).add(new BigDecimal(value2.trim())); return String.valueOf(result); |
void | addBigDecimalsInMap(Map add Big Decimals In Map if (baseMap == null || addMap == null) return; for (Map.Entry<String, Object> entry : addMap.entrySet()) { if (!(entry.getValue() instanceof BigDecimal)) continue; BigDecimal addVal = (BigDecimal) entry.getValue(); Object baseObj = baseMap.get(entry.getKey()); if (baseObj == null || !(baseObj instanceof BigDecimal)) ... |
BigDecimal | addPercent(BigDecimal price, double amount) add Percent return price.add(getPercentageValue(price, amount));
|
BigDecimal | addQtde(BigDecimal val1, BigDecimal val2) add Qtde BigDecimal aux = val1; aux = aux.setScale(decQtde, roundingMode); return aux.add(val2).setScale(decQtde, roundingMode); |
void | addSalePrice(Map add Sale Price if (!complexSalePrice.containsKey(saleKey)) { complexSalePrice.put(saleKey, saleprice); } else { BigDecimal existedPrice = complexSalePrice.get(saleKey); BigDecimal priceResult = existedPrice == null ? BigDecimal.ZERO : existedPrice; complexSalePrice.put(saleKey, priceResult.add(saleprice)); |
BigDecimal | addToBigDecimalInMap(Map Assuming theMap not null; if null will throw a NullPointerException Object currentNumberObj = theMap.get(mapKey); BigDecimal currentNumber = null; if (currentNumberObj == null) { currentNumber = ZERO_BD; } else if (currentNumberObj instanceof BigDecimal) { currentNumber = (BigDecimal) currentNumberObj; } else if (currentNumberObj instanceof Double) { currentNumber = new BigDecimal(((Double) currentNumberObj).doubleValue()); ... |
void | addToBigDecimalInMap(Object key, BigDecimal value, Map theMap) add To Big Decimal In Map if (value == null || theMap == null) return; Object curObj = theMap.get(key); if (curObj == null) { theMap.put(key, value); } else { BigDecimal curVal; if (curObj instanceof BigDecimal) ... |
BigDecimal | addUlp(BigDecimal x) add Ulp BigInteger unscaledValue = x.unscaledValue(); unscaledValue = unscaledValue.add(BigInteger.ONE); return new BigDecimal(unscaledValue, x.scale()); |
int | addVAT(int priceInCents, BigDecimal vat) add VAT return addVAT(new BigDecimal(priceInCents), vat).intValueExact(); |
BigDecimal | addVatAmount(BigDecimal percentage, BigDecimal amount) add Vat Amount return amount.multiply(percentage.divide(HUNDRED));
|