Java Utililty Methods BigDecimal Multiply

List of utility methods to do BigDecimal Multiply

Description

The list of methods to do BigDecimal Multiply are organized into topic(s).

Method

BigDecimalmultiply(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);
...
BigDecimalmultiply(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;
...
BigDecimalmultiply(final BigDecimal value, final BigDecimal multiplicand)
multiply
BigDecimal diff = null;
if (value != null && multiplicand != null) {
    diff = value.multiply(multiplicand);
return diff;
BigDecimalmultiplyBy(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));
BigDecimalmultiplyFactor(BigDecimal val, float factor)
Vermenigvuldigt een BigDecimal met een factor.
int scale = 5;
return multiplyFactor(val, factor, scale);
BigDecimalmultiplyMoeda(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);
...
BigDecimalmultiplyQtde(BigDecimal val1, BigDecimal val2)
multiply Qtde
BigDecimal aux = val1;
aux = aux.setScale(decQtde, roundingMode);
return aux.multiply(val2).setScale(decQtde, roundingMode);