Can you get access to the NumberFormatter used by ICU MessageFormat

Posted by Travis on Stack Overflow See other posts from Stack Overflow or by Travis
Published on 2010-03-23T00:04:44Z Indexed on 2010/03/24 3:33 UTC
Read the original article Hit count: 412

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about c++

Related posts about unicode