Example usage for java.text NumberFormat FRACTION_FIELD

List of usage examples for java.text NumberFormat FRACTION_FIELD

Introduction

In this page you can find the example usage for java.text NumberFormat FRACTION_FIELD.

Prototype

int FRACTION_FIELD

To view the source code for java.text NumberFormat FRACTION_FIELD.

Click Source Link

Document

Field constant used to construct a FieldPosition object.

Usage

From source file:Main.java

public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getPercentInstance();

    StringBuffer sb = new StringBuffer();

    Object value = 11.111;/*from   w w  w  .j  av a2  s  .c  o m*/
    numberFormat.format(value, sb, new FieldPosition(NumberFormat.FRACTION_FIELD));
    System.out.println(sb);

}