JasperReport数字金额格式化
使用iReport做报表时,需要将金额转换成"1,000,000.00"格式。
1、确定Field为数字类型(BigDecimal),即传入的数据对象金额属性的数据类型也为BigDecimal;
2、在报表模板中,设置Text Field标签的属性:
(1)Expression Class : java.math.BigDecimal
(2)Pattern : #,##0.00
使用iReport做报表时,需要将金额转换成"1,000,000.00"格式。
1、确定Field为数字类型(BigDecimal),即传入的数据对象金额属性的数据类型也为BigDecimal;
2、在报表模板中,设置Text Field标签的属性:
(1)Expression Class : java.math.BigDecimal
(2)Pattern : #,##0.00