Java Format - Java NumberFormat .getInstance (Locale inLocale)


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

public static NumberFormat getInstance(Locale inLocale)


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

//from   www . j a  v  a  2 s  .com
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);

The code above generates the following result.