NumberFormat SetGroupingUsed() Example
Set whether or not grouping will be used in this format.
NumberFormatclass SetGroupingUsed() method example. This example shows you how to use SetGroupingUsed() method.This method Set whether or not grouping will be used in this format.
Here is the code:-
/**
* @Program that Set whether or not grouping will be used in this format.
* SetGroupingUsed.java
* Author:-RoseIndia Team
* Date:-17-Jun-2008
*/
import java.text.*;
import java.util.*;
public class SetGroupingUsed {
public static void main(String[] args) {
//Creating Numberformat instance
NumberFormat nf = NumberFormat.getInstance();
System.out.println("Grouping is used: "+nf.isGroupingUsed());
nf.setGroupingUsed(false);
System.out.println("Grouping is used: "+nf.isGroupingUsed());
}
} |
Output of the program:-
Grouping is used: true
Grouping is used: false
|
|