Get the currency format for a country that does not have a Locale constant

前端 未结 6 1104
醉梦人生
醉梦人生 2020-12-29 02:44

I want to get the currency format of India, so I need a Locale object for India. But there exists only few a countries that have a Locale constant

6条回答
  •  一个人的身影
    2020-12-29 03:18

    According to the JDK release notes, you have locale codes hi_IN (Hindi) and en_IN (English).

    System.out.println(Currency.getInstance(new Locale("hi", "IN")).getSymbol());
    

提交回复
热议问题