If you have the ISO country code `US`, `FR`, how do you get the Locale code (`Locale.US`, `Locale.FRANCE`)?
问题 If you have the country code US , FR (ISO-3166-1 alpha-2 country code), how do you get the Locale code ( Locale.US , Locale.FRANCE ) to do something like this: System.out.println(DecimalFormat.getCurrencyInstance(Locale.US).format(12.34)); System.out.println(DecimalFormat.getCurrencyInstance(Locale.FRANCE).format(12.34)); $12.34 12,34 € 回答1: You can't, because a Locale is used to hold a language, not a country. It can hold a language for a specific country, and for a specific variant in this