Java BigDecimal Add addSalePrice(Map complexSalePrice, BigDecimal saleprice)

Here you can find the source of addSalePrice(Map complexSalePrice, BigDecimal saleprice)

Description

add Sale Price

License

Open Source License

Declaration

private static void addSalePrice(Map<String, BigDecimal> complexSalePrice, BigDecimal saleprice) 

Method Source Code


//package com.java2s;
import java.math.BigDecimal;

import java.util.Map;

public class Main {
    private static String saleKey = "SalePrice";

    private static void addSalePrice(Map<String, BigDecimal> complexSalePrice, BigDecimal saleprice) {
        if (!complexSalePrice.containsKey(saleKey)) {
            complexSalePrice.put(saleKey, saleprice);
        } else {/*ww  w  . j av a 2s .c om*/
            BigDecimal existedPrice = complexSalePrice.get(saleKey);
            BigDecimal priceResult = existedPrice == null ? BigDecimal.ZERO : existedPrice;
            complexSalePrice.put(saleKey, priceResult.add(saleprice));
        }
    }
}

Related

  1. addBigDecimal(BigDecimal a, BigDecimal b)
  2. addBigDecimals(String value1, String value2)
  3. addBigDecimalsInMap(Map baseMap, Map addMap)
  4. addPercent(BigDecimal price, double amount)
  5. addQtde(BigDecimal val1, BigDecimal val2)
  6. addToBigDecimalInMap(Map theMap, K mapKey, BigDecimal addNumber)
  7. addToBigDecimalInMap(Object key, BigDecimal value, Map theMap)
  8. addUlp(BigDecimal x)
  9. addVAT(int priceInCents, BigDecimal vat)