Java BigDecimal Multiply multiply(BigDecimal number1, BigDecimal number2, int decimalPlaces)

Here you can find the source of multiply(BigDecimal number1, BigDecimal number2, int decimalPlaces)

Description

multiply

License

Apache License

Declaration

private static BigDecimal multiply(BigDecimal number1, BigDecimal number2, int decimalPlaces) 

Method Source Code


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

import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;

public class Main {
    private static final MathContext mathContext = MathContext.DECIMAL128;
    private static final RoundingMode roundingMode = RoundingMode.HALF_UP;

    private static BigDecimal multiply(BigDecimal number1, BigDecimal number2, int decimalPlaces) {
        return number1.multiply(number2, mathContext).setScale(decimalPlaces, roundingMode);
    }/*www . j a  v a2  s . co m*/
}

Related

  1. multiply(BigDecimal bigDecimal, BigDecimal bigDecimal2)
  2. multiply(BigDecimal left, BigDecimal right)
  3. multiply(BigDecimal multiplier1, BigDecimal multiplier2, int scale)
  4. multiply(BigDecimal num1, BigDecimal num2)
  5. multiply(BigDecimal num1, BigDecimal num2)
  6. multiply(BigDecimal one, BigDecimal another)
  7. multiply(BigDecimal op1, int op2)
  8. multiply(BigDecimal toBeMultiplied, int multiplyBy)
  9. multiply(BigDecimal v1, BigDecimal v2)