struts2数字格式化
src下资源文件applicationResource.properties添加内容
?
format.number = {0,number,###,###.00}format.discount = {0,number,###.#######%}?
?
struts.xml配置
?
<constant name="struts.custom.i18n.resources" value="applicationResource"></constant>
?
?xxx.jsp显示
?
s:text name="format.number"> <s:param value="xxx1"/></s:text><s:text name="format.discount"> <s:param value="xxx2"/></s:text>
?
?当显示0.xx或者0.xx%的时候,不显示0,只显示.xx或者.xx%
修改applicationResource.properties内容为
?
format.number={0,number,###,##0.00}format.discount={0,number,##0.#######%}