I have currency code and value in double. Need to do formating for Currencies.I tried with NumberFormat and Locale but in this case for example EURO has different Locale related to countries. How can I achieve this?, Is there any common format for Euro?
format.setCurrency(Currency.getInstance("EUR"));
format.setMaximumFractionDigits(2);
System.out.println(format.format(dbl));
Locale[] locales = NumberFormat.getAvailableLocales();
for(Locale lo : locales){
NumberFormat format = NumberFormat.getCurrencyInstance(lo);
if(NumberFormat.getCurrencyInstance(lo).getCurrency().getCurrencyCode().equals("EUR")){
System.out.println( NumberFormat.getCurrencyInstance(lo).getCurrency().getCurrencyCode()+"-"+lo.getDisplayCountry() +"-"+NumberFormat.getCurrencyInstance(lo).getCurrency().getSymbol() +format.format(dbl));
}
}```
Sorry previous question was closed.