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