DecimalFormatSymbols SetZeroDigit() Example
Sets the character used for zero.
DecimalFormatSymbolsclass SetZeroDigit() method example. This example shows you how to use SetZeroDigit() method.This method Sets the character used for zero.
Here is the code:-
/**
* @Program that Sets the character used for zero.
* SetZeroDigit.java
* Author:-RoseIndia Team
* Date:-14-Jun-2008
*/
import java.text.*;
public class SetZeroDigit {
public static void main(String[] args) {
DecimalFormatSymbols dfs = new DecimalFormatSymbols();
//Gets the character used for zero.
char c = dfs.getZeroDigit();
System.out.println("The character used for zero is: " + c);
dfs.setZeroDigit('_');
System.out.println("The character used for zero is: " +dfs.getZeroDigit());
}
} |
Output of the program:-
The character used for zero is: 0
The character used for zero is: _ |
|