NumberFormat GetCurrencyInstance1() Example
Returns a currency format for the specified locale.
NumberFormatclass GetCurrencyInstance1() method example. This example shows you how to use GetCurrencyInstance1() method.This method Returns a currency format for the specified locale.
Here is the code:-
/**
* @Program that Returns a currency format for the specified locale.
* GetCurrencyInstance1.java
* Author:-RoseIndia Team
* Date:-17-Jun-2008
*/
import java.text.*;
import java.util.*;
public class GetCurrencyInstance1 {
public static void main(String[] args) {
//Creating Numberformat instance
NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.JAPAN);
System.out.println("Currency format for the specified locale: " + nf.getCurrency());
}
} |
Output of the program:-
Currency format for the specified locale: JPY
|
|