Java DecimalFormat .setParseBigDecimal (boolean newValue)

Syntax

DecimalFormat.setParseBigDecimal(boolean newValue) has the following syntax.

public void setParseBigDecimal(boolean newValue)

Example

In the following code shows how to use DecimalFormat.setParseBigDecimal(boolean newValue) method.


import java.text.DecimalFormat;
/*from  w w  w.  jav  a  2  s .c  om*/
public class Main {
  public static void main(String[] argv) throws Exception {
    DecimalFormat format = new DecimalFormat();
    format.setParseBigDecimal(true);
    System.out.println(format.format(12345678912345678L));

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat