NumberFormat GetCurrency() Example
Gets the currency used by this number format when formatting currency values.
NumberFormat GetCurrency() method example. This example shows you how to use GetCurrency() method.This method Gets the currency used by this number format when formatting currency values.
Here is the code:-
/**
* @Program that Gets the currency used by this number format when formatting
* currency values.
* GetCurrency.java
* Author:-RoseIndia Team
* Date:-17-Jun-2008
*/
import java.text.*;
import java.util.*;
public class GetCurrency {
public static void main(String[] args) {
//Creating Numberformat instance
NumberFormat nf = NumberFormat.getInstance();
System.out.println("Currency used by this number format is: "+nf.getCurrency());
}
} |
Output of the program:-
| Currency used by this number format is: INR |
|