Java Data Type Tutorial - Java BigDecimal .multiply (BigDecimal multiplicand)








Syntax

BigDecimal.multiply(BigDecimal multiplicand) has the following syntax.

public BigDecimal multiply(BigDecimal multiplicand)

Example

In the following code shows how to use BigDecimal.multiply(BigDecimal multiplicand) method.

/*from w ww.j  av a 2 s  .c o  m*/
import java.math.BigDecimal;

public class Main {

  public static void main(String[] args) {

    BigDecimal bg1 = new BigDecimal("1.230");
    BigDecimal bg2 = new BigDecimal("4.560");

    BigDecimal bg3 = bg1.multiply(bg2);

    System.out.println(bg3);
  }
}

The code above generates the following result.