首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

struts 二数字格式化话

2012-08-29 
struts 2数字格式化话--jsp页面s:textfield maxLength15 namenonTopicPlanTask.unitSituationRegFun

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

?

?

热点排行