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.


//  ww w.j a  v  a  2s.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.





















Home »
  Java Tutorial »
    java.math »




BigDecimal
BigInteger