Java DecimalFormat() Constructor

Syntax

DecimalFormat() constructor from DecimalFormat has the following syntax.

public DecimalFormat()

Example

In the following code shows how to use DecimalFormat.DecimalFormat() constructor.


import java.text.DecimalFormat;
/*from  w  w  w . jav a2s.  c  o m*/
public class Main {
  public static void main(String[] argv) throws Exception {
    DecimalFormat format = new DecimalFormat();
    
    System.out.println(format.getGroupingSize());

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat