Currency code to currency symbol mapping

前端 未结 6 1929
太阳男子
太阳男子 2021-02-07 09:46

Good day, in database there is table with houses for sale records. For each house record there is currency code (in ISO 4217 format) field. Is it possibly to somehow get currenc

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-07 10:18

    You can use the Currency object's getSymbol method.

    What symbol is used depends on the Locale which is used See this and this.

    Update, Jan 2016: The links are now dead. But they were specific to Java 1.4/5 so not really relevant anymore. More details on currency formatting can be found in https://docs.oracle.com/javase/tutorial/i18n/format/numberFormat.html. The links can be found on the WayBackEngine though.

提交回复
热议问题