DecimalFormat GetDecimalFormatSymbols() Example
Returns a copy of the decimal format symbols, which is generally not changed by the programmer or user.
DecimalFormatclass GetDecimalFormatSymbols() method example. This example shows you how to use GetDecimalFormatSymbols() method.This method Returns a copy of the decimal format symbols, which is generally not changed by the programmer or user.
Here is the code:-
/**
* @Program that Returns a copy of the decimal format symbols, which is not
* changed by the programmer or user.
* GetDecimalFormatSymbols.java
* Author:-RoseIndia Team
* Date:-12-Jun-2008
*/
import java.text.*;
public class GetDecimalFormatSymbols {
public static void main(String[] args) {
// Creates a DecimalFormat object
DecimalFormat d = new DecimalFormat();
//Returns a copy of the decimal format symbols
DecimalFormatSymbols dfs = d.getDecimalFormatSymbols();
System.out.println("Decimal Separator is:" + dfs.getDecimalSeparator());
System.out.println("Exponent Separator is:" + dfs.getExponentSeparator());
}
} |
Output of the Program
Decimal Separator is:.
Exponent Separator is:E |
|