How to display Indian Numbering format in iReport?

2019-07-15 13:08发布

I am using iReports to generate Reports. I want to display the GrandTotal fields in Indian Numbering Format. For Example,

Value: 1,000,000 should be displayed as 10,00,000

I tried using Pattern of text field properties, but not able to get the result. And in some forums they have mentioned to use JRParameter.REPORT_LOCALE. I tried this way

Locale locale = new Locale("en", "IN");
parameters.put(JRParameter.REPORT_LOCALE, locale);

where parameters is a map which is then used to fill report.

Any help is appreciated

Thanks

1条回答
女痞
2楼-- · 2019-07-15 14:11

If you use ICU4J you can do something like

com.ibm.icu.text.NumberFormat.getCurrencyInstance(new Locale("en", "in")).format(new Java.math.BigDecimal(${FIELD_HOLDING_THE_VALUE}));

NumberFormat of ICU4J is explained in this thread

查看更多
登录 后发表回答