DecimalFormat ToLocalizedPattern() Example
Synthesizes a localized pattern string
DecimalFormatclass ToLocalizedPattern() method example. This example shows you how to use ToLocalizedPattern() method.This method Synthesizes a localized pattern string
Here is the code:-
/**
* @Program that Synthesizes a localized pattern string that represents the
* current state of this Format object.
* ToLocalizedPattern.java
* Author:-RoseIndia Team
* Date:-13-Jun-2008
*/
import java.text.*;
public class ToLocalizedPattern {
public static void main(String[] args) {
// Creates a DecimalFormat object
DecimalFormat d = new DecimalFormat();
//Apply the given pattern to this Format object.
d.applyLocalizedPattern("#,#00.0#");
//Synthesizes a localized pattern string
String s=d.toLocalizedPattern();
System.out.println("Current state of this Format object."+s);
}
} |
Output of the Program
| Current state of this Format object.#,#00.0# |
|