Java BigDecimal(BigInteger unscaledVal, int scale) Constructor

Syntax

BigDecimal(BigInteger unscaledVal, int scale) constructor from BigDecimal has the following syntax.

public BigDecimal(BigInteger unscaledVal,   int scale)

Example

In the following code shows how to use BigDecimal.BigDecimal(BigInteger unscaledVal, int scale) constructor.


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

public class Main {

  public static void main(String[] args) {

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

  }
}




















Home »
  Java Tutorial »
    java.math »




BigDecimal
BigInteger