List of utility methods to do BigDecimal Multiply
BigDecimal | multiply(BigDecimal... operands) Returns the multiplication of all the given decimals. BigDecimal result = null; if (operands != null) { for (BigDecimal operand : operands) { if (operand != null) { if (result == null) { result = operand; } else { result = result.multiply(operand); ... |
BigDecimal | multiply(final BigDecimal val1, final BigDecimal val2) multiply if (val1 == null) { if (val2 == null) { return BigDecimal.ZERO; } else { return val2; } else if (val2 == null) { return val1; ... |
BigDecimal | multiply(final BigDecimal value, final BigDecimal multiplicand) multiply BigDecimal diff = null; if (value != null && multiplicand != null) { diff = value.multiply(multiplicand); return diff; |
BigDecimal | multiplyBy(BigDecimal multiplicand, BigDecimal multiplier) Returns a BigDecimal whose value is (this × multiplicand), and whose scale is (this.scale() + multiplicand.scale()) . return setScale(multiplicand.multiply(multiplier));
|
BigDecimal | multiplyFactor(BigDecimal val, float factor) Vermenigvuldigt een BigDecimal met een factor. int scale = 5; return multiplyFactor(val, factor, scale); |
BigDecimal | multiplyMoeda(BigDecimal val1, BigDecimal val2) multiply Moeda if (val1.scale() < val2.scale()) { BigDecimal aux = (val1 != null ? val1 : newMoeda()); aux = aux.setScale(decMoeda, roundingMode); return aux.multiply((val2 != null ? val2 : newMoeda())).setScale(decMoeda, roundingMode); } else { BigDecimal aux = (val2 != null ? val2 : newMoeda()); aux = aux.setScale(decMoeda, roundingMode); return aux.multiply((val1 != null ? val1 : newMoeda())).setScale(decMoeda, roundingMode); ... |
BigDecimal | multiplyQtde(BigDecimal val1, BigDecimal val2) multiply Qtde BigDecimal aux = val1; aux = aux.setScale(decQtde, roundingMode); return aux.multiply(val2).setScale(decQtde, roundingMode); |