0
点赞
收藏
分享

微信扫一扫

struts 2数字格式化话


--jsp页面

<s:textfield maxLength="15" name="nonTopicPlanTask.unitSituationRegFund" id="unitSituationRegFund"
           value="%{getText('format.wan',{nonTopicPlanTask.unitSituationRegFund/10000})}" />

 

--循环迭代例子

<s:iterator id="nonTopicFundUse" value="nonTopicFundUseList"
        status="st">.......
 
<input type="text"
           name="nonTopicFundUseList[<s:property value="#st.index"/>].price"
           value="<s:property value='%{getText("format.wan",{#nonTopicFundUse.price})}'/>"
           id="fundUsePrice<s:property value='#st.index'/>"
           maxLength="15" /> 
<s:iterator>

 

--配置文件

message.properties

#元的格式
format.number ={0,number,##0.##}

#万元的格式
format.wan ={0,number,##0.######}

#百分比格式
format.percent ={0,number,\#\#0.\#\#}

 

 

参考 http://qindyyx.iteye.com/blog/1042562

 

struts2官方说明 Formatting Dates and Numbers

http://struts.apache.org/2.0.11.1/docs/formatting-dates-and-numbers.html

 

 

举报

相关推荐

0 条评论