List of utility methods to do BigDecimal Subtract
BigDecimal | subtractPercent(BigDecimal price, double amount) subtract Percent return price.subtract(getPercentageValue(price, amount));
|
BigDecimal | subtractQtde(BigDecimal val1, BigDecimal val2) subtract Qtde BigDecimal aux = val1; aux = aux.setScale(decQtde, roundingMode); return aux.subtract(val2).setScale(decQtde, roundingMode); |
BigDecimal | subtractVatAmount(BigDecimal percentage, BigDecimal amount) subtract Vat Amount BigDecimal f = BigDecimal.ONE
.subtract(BigDecimal.ONE.divide(percentage.add(HUNDRED).divide(HUNDRED), 14, RoundingMode.HALF_UP));
return amount.multiply(f).setScale(2, RoundingMode.HALF_UP);
|
BigDecimal | subUlp(BigDecimal x) sub Ulp BigInteger unscaledValue = x.unscaledValue(); unscaledValue = unscaledValue.subtract(BigInteger.ONE); return new BigDecimal(unscaledValue, x.scale()); |