Java Format - Java NumberFormat .getMaximumFractionDigits ()








Syntax

NumberFormat.getMaximumFractionDigits() has the following syntax.

public int getMaximumFractionDigits()

Example

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

import java.text.NumberFormat;
import java.util.Locale;

public class Main {
  public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getIntegerInstance(Locale.CANADA);
    System.out.println(numberFormat.getMaximumFractionDigits());
  }
}

The code above generates the following result.