Java Format - Java DecimalFormat .getMaximumFractionDigits ()








Syntax

DecimalFormat.getMaximumFractionDigits() has the following syntax.

public int getMaximumFractionDigits()

Example

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

import java.text.DecimalFormat;
/*from w ww . j  a v a 2 s.co m*/
public class Main {
  public static void main(String[] argv) throws Exception {
    DecimalFormat format = new DecimalFormat();
    
    System.out.println(format.getMaximumFractionDigits());

  }
}

The code above generates the following result.