DecimalFormat SetGroupingSize() Example
Set the grouping size.
DecimalFormatclass SetGroupingSize() method example. This example shows you how to use SetGroupingSize() method.This method Set the grouping size.
Here is the code:-
/**
* @Program that Set the grouping size.
* SetGroupingSize.java
* Author:-RoseIndia Team
* Date:-13-Jun-2008
*/
import java.text.*;
public class SetGroupingSize {
public static void main(String[] args) {
// Creates a DecimalFormat object
DecimalFormat d = new DecimalFormat();
//Return the grouping size.
System.out.println("The grouping size is :" + d.getGroupingSize());
//Set the grouping size.
d.setGroupingSize(5);
System.out.println("The grouping size is :" + d.getGroupingSize());
}
} |
Output of the Program
The grouping size is :3
The grouping size is :5 |
|