开发者

Can you get access to the NumberFormatter used by ICU MessageFormat

This may be a niche question but I'm working with ICU to format currency strings. I've bumped into a situation that I don't quite understand.

When using the MesssageFormat class, is it possible to get access to the NumberFormat object it uses to format currency strings. When you create a NumberFormat instance yourself, you can specify attributes like precision and rounding used when creating currency strings.

I have an issue where for the South Korean locale ("ko_KR"), the MessageFormat class seems 开发者_运维知识库to create currency strings w/ rounding (100.50 -> ₩100).

In areas where I use NumberFormat directly, I set setMaximumFractionDigits and setMinimumFractionDigits to 2 but I can't seem to set this in the MessageFormat.

Any ideas?


Probably because one Korean Won is worth $0.00088. They don't have pennies.

Same idea with the Swiss Franc, the 1 centime coin stopped being legal tender in 2007.


I've determined that gaining access to the internal formatter used is not possible. I've opened a ticket with the ICU project. http://bugs.icu-project.org/trac/ticket/7571#preview

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜