Java: Currency to Locale Mapping Possible?

后端 未结 4 1200
Happy的楠姐
Happy的楠姐 2020-12-16 12:11

I have a value stored in a DB correlating to a monetary amount, say 10.0. I also have access to the Currency/CurrencyCode. How can I use NumberFormat/DecimalFormat/(other?)

4条回答
  •  孤城傲影
    2020-12-16 12:56

    I would say that if your database is storing a currency value it should be hanging onto the units at the same time. It sounds like you're doing that now. Can you add the Locale to the database at the same time? Could be a decent solution.

提交回复
热议问题