Java BigDecimal Subtract subtractPercent(BigDecimal price, double amount)

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

Description

subtract Percent

License

Apache License

Declaration

public static BigDecimal subtractPercent(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 subtractPercent(BigDecimal price, double amount) {
        return price.subtract(getPercentageValue(price, amount));
    }//from  w w  w  .  j  a v  a2s .  c o  m

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

Related

  1. subtract(final BigDecimal baseAmount, final BigDecimal amountToSubtract)
  2. subtract(final BigDecimal start, final BigDecimal... values)
  3. subtract(float a, BigDecimal b_bd)
  4. subtract(Vector a, Vector b)
  5. subtract2Abs(BigDecimal aValue1, BigDecimal aValue2)
  6. subtractQtde(BigDecimal val1, BigDecimal val2)
  7. subtractVatAmount(BigDecimal percentage, BigDecimal amount)
  8. subUlp(BigDecimal x)