Java NumberFormat .getPercentInstance ()

Syntax

NumberFormat.getPercentInstance() has the following syntax.

public static final NumberFormat getPercentInstance()

Example

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


// ww w .j ava  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.getPercentInstance();
    System.out.println(numberFormat.getMaximumFractionDigits());
  }
}




















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat