NumberFormat Format3() Example
describes Specialization of format.
NumberFormatclass Format3() method example. This example shows you how to use Format3() method.This method describes Specialization of format.
Here is the code:-
/**
* @Program that gives Specialization of format.
* Format3.java
* Author:-RoseIndia Team
* Date:-17-Jun-2008
*/
import java.text.*;
public class Format3 {
public static void main(String[] args) {
//Creating Numberformat instance
NumberFormat nf = NumberFormat.getInstance();
StringBuffer sb=new StringBuffer("Girish");
FieldPosition fp=new FieldPosition(2);
System.out.println("The resulting text is: "+nf.format(123456, sb, fp));
}
} |
Output of the program:-
| The resulting text is: Girish123,456 |
|