How to customize currency formatting in MessageFormat in ICU4J

godosrats

New Member
I have a system that generates a lot of documents. Its contents are defined in ResourceBundles. I want to customize the way MessageFormat prints currency values. Sometimes I want it to display currencies without fraction digits (but not always). This should be working as expected but it is not:\[code\]System.err.println( com.ibm.icu.text.MessageFormat.format( "{0,number,\u00A4#}", new com.ibm.icu.util.CurrencyAmount(1, com.ibm.icu.util.Currency.getInstance("USD"))));\[/code\]Unfortunately it prints out:\[code\]US$1,00\[/code\]Does anyone of you use custom formats for currency in resource bundle 'properties' files?I don't want to change it system wide.And by the way this works fine with java.text.MessageFormat.
 
Back
Top