I am surprised that I am having real problems with how to do this. I think it should be pretty simple. Maybe I'm looking in the wrong place.
Suppose I have the following code:
double amount = 123.45D;
Locale uk = Locale.UK;
Locale fr = Locale.FR;
Currency euro = Currency.getInstance("EUR");
How do I get instances of NumberFormat that allow me to print the value 123.45 correctly formatted for Locale? those. I want the following for the UK and France respectively:
€123.45
123,45 €
I can not use NumberFormat.getCurrencyInstance(Locale), because the format will format in the UK as Sterling (£). I am looking NumberFormat.getCurrencyInstance(Locale, Currency), but this does not seem to exist.
Any ideas?
source
share