DecimalFormat SetDecimalFormatSymbols() Example
Sets the decimal format symbols
DecimalFormatclass SetDecimalFormatSymbols() method example. This example shows you how to use SetDecimalFormatSymbols() method.This method Sets the decimal format symbols, which is generally not changed by the programmer or user
Here is the code:-
/**
* @Program that Sets the decimal format symbols, which is generally not
* changed by the programmer or user.
* SetDecimalFormatSymbols.java
* Author:-RoseIndia Team
* Date:-13-Jun-2008
*/
import java.text.*;
public class SetDecimalFormatSymbols {
public static void main(String[] args) {
// Create a new DecimalFormat object.
DecimalFormat decForm = new DecimalFormat();
DecimalFormatSymbols dfs = new DecimalFormatSymbols();
//Sets the decimal format symbols
decForm.setDecimalFormatSymbols(dfs);
System.out.println("DecimalFormatSymbols.getDecimalSeparator: " +
dfs.getDecimalSeparator());
System.out.println("DecimalFormatSymbols.getDigit: " +
dfs.getDigit());
}
} |
Output of the Program
DecimalFormatSymbols.getDecimalSeparator: .
DecimalFormatSymbols.getDigit: # |
|