Java BigDecimal Add addPercent(BigDecimal price, double amount)

Here you can find the source of addPercent(BigDecimal price, double amount)

Description

add Percent

License

Apache License

Declaration

public static BigDecimal addPercent(BigDecimal price, double amount) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.math.BigDecimal;

public class Main {
    public static BigDecimal addPercent(BigDecimal price, double amount) {
        return price.add(getPercentageValue(price, amount));
    }//from w w w. ja v  a  2  s  .c  o  m

    private static BigDecimal getPercentageValue(BigDecimal price, double amount) {
        return price.multiply(new BigDecimal(amount / 100));
    }
}

Related

  1. add2Abs(BigDecimal aValue1, BigDecimal aValue2)
  2. addBigDec(BigDecimal b1, BigDecimal b2)
  3. addBigDecimal(BigDecimal a, BigDecimal b)
  4. addBigDecimals(String value1, String value2)
  5. addBigDecimalsInMap(Map baseMap, Map addMap)
  6. addQtde(BigDecimal val1, BigDecimal val2)
  7. addSalePrice(Map complexSalePrice, BigDecimal saleprice)
  8. addToBigDecimalInMap(Map theMap, K mapKey, BigDecimal addNumber)
  9. addToBigDecimalInMap(Object key, BigDecimal value, Map theMap)