import java.util.*;
import java.lang.*;
import java.text.*;


class CurrencyFormat {
	public static void main (String[] args) throws java.lang.Exception {
		Map<String, String> languagesMap = new TreeMap<String, String>();
        Locale[] locales = Locale.getAvailableLocales();
        for (Locale obj : locales) {
            if ((obj.getDisplayCountry() != null) && (!"".equals(obj.getDisplayCountry()))) {
                languagesMap.put(obj.getCountry(), obj.getLanguage());
            }
        }

        String[] countries = Locale.getISOCountries();
        int supportedLocale = 0, nonSupportedLocale = 0;
        for (String countryCode : countries) {
            Locale obj = null;
            if (languagesMap.get(countryCode) == null) {
                obj = new Locale("", countryCode);
                nonSupportedLocale++;
            }
            else {
                //create a Locale with own country's languages
                obj = new Locale(languagesMap.get(countryCode), countryCode);
                supportedLocale++;

            }
            NumberFormat currency = NumberFormat.getCurrencyInstance(obj);
            DecimalFormatSymbols decimalFormatSymbols = ((DecimalFormat) currency).getDecimalFormatSymbols();
            String currencySymbol = decimalFormatSymbols.getCurrencySymbol();
            decimalFormatSymbols.setCurrencySymbol("");
            ((DecimalFormat) currency).setDecimalFormatSymbols(decimalFormatSymbols);

            System.out.println("Country Code = " + obj.getISO3Country()
                    + ", Price = " + currency.format(35147869.3518).trim()
                    + ", Symbol: " + currencySymbol
                    + ", Name: " + decimalFormatSymbols.getCurrency().getDisplayName()
                    + ", Code: " + decimalFormatSymbols.getCurrency().getCurrencyCode());
        }
        System.out.println("nonSupportedLocale : " + nonSupportedLocale);
        System.out.println("supportedLocale : " + supportedLocale);
	}
}