Java BigDecimal(BigInteger val) Constructor

Syntax

BigDecimal(BigInteger val) constructor from BigDecimal has the following syntax.

public BigDecimal(BigInteger val)

Example

In the following code shows how to use BigDecimal.BigDecimal(BigInteger val) constructor.


import java.math.BigDecimal;
import java.math.BigInteger;
// www  .  java 2s.c  o  m
public class Main {

  public static void main(String[] args) {

    BigDecimal bg1 = new BigDecimal(new BigInteger("40"));

  }
}




















Home »
  Java Tutorial »
    java.math »




BigDecimal
BigInteger