Java: Currency symbol based on ISO 4217 currency cod

后端 未结 4 450
生来不讨喜
生来不讨喜 2021-02-05 06:45

Below program prints the Currency symbol given the ISO 4217 currency code.

import java.util.*;

public class Currency{

    public static void main(String args[]         


        
4条回答
  •  我在风中等你
    2021-02-05 07:20

    Using the limited Locale enum's only caters for westernised symbols. If you want to be a little more global try using Locales provided by:

    Locale[] locales = Locale.getAvailableLocales();
    

    Using Locales from this list gave symbols rather than TLA's pretty consistently.

提交回复
热议问题