DecimalFormatSymbols GetCurrencySymbol() Example
Returns the currency symbol for the currency of these DecimalFormatSymbols in their locale.
DecimalFormatSymbolsclass GetCurrencySymbol() method example. This example shows you how to use GetCurrencySymbol() method.This method Returns the currency symbol for the currency of these DecimalFormatSymbols in their locale.
Here is the code:-
/**
* @Program that Returns the currency symbol for the currency of these
* DecimalFormatSymbols in their locale.
* GetCurrencySymbol.java
* Author:-RoseIndia Team
* Date:-14-Jun-2008
*/
import java.text.*;
import java.util.*;
public class GetCurrencySymbol {
public static void main(String[] args) {
DecimalFormatSymbols dfs = new DecimalFormatSymbols(new Locale("English"));
String s=dfs.getCurrencySymbol();
System.out.println("currency symbol for the currency: "+s);
}
} |
Output of the Program
| currency symbol for the currency: ¤ |
|