I tried a lot.But was unable to find a solution. I have a code for formatting currency. I am using the below code :
NumberFormat numberFormat = NumberFormat.getCurrencyInstance(locale);
Here I am facing an issue. Consider a case with France locale. In my case, locale can be en_FR and fr_FR.
DecimalFormatSymbols decimalFormats = new DecimalFormatSymbols();
decimalFormats.setCurrencySymbol(currencySymbol);
((DecimalFormat) numberFormat).setDecimalFormatSymbols(decimalFormats);
formattedCurrency = numberFormat.format(Double.valueOf(number));
So if the locale is en_FR, the formattedCurrency value will be € 10.00 and if the locale is fr_FR, the value will be 10.00 €.
So I would like to know the role of language code in this calculation methods.Since en_FR has en, I guess it is by default taking as en_US. So currency symbol coming left of price.
I need to get 10.00 € always if the country is France irrespective of language code. Is there are other way to get the currency formatting based on country, rather than locale?