Java NumberFormat .getInstance (Locale inLocale)

Syntax

NumberFormat.getInstance(Locale inLocale) has the following syntax.

public static NumberFormat getInstance(Locale inLocale)

Example

In the following code shows how to use NumberFormat.getInstance(Locale inLocale) method.


//from w w  w. j a  v a 2 s.c o  m
import java.text.NumberFormat;
import java.util.Locale;

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




















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat