JQuery EasyUI 数字格式化处理示例
设置显示时间戳
<%
request.setattribute("currenttimestamp",calendar.getinstance().gettime());
%>
显示:2009-11
<fmt:formatdate pattern="yyyy-mm" value="${currenttimestamp}"/> <br/>
显示:2009-11-30 23:47:06
<fmt:formatdate pattern="yyyy-mm-dd hh:mm:ss" value="${currenttimestamp}"/> <br/>
显示:$12.00
<fmt:formatnumber value="12" type="currency" pattern="$.00"/> <br/>
显示:$12.0
<fmt:formatnumber value="12" type="currency" pattern="$.#"/> <br/>
¥12.0
<fmt:formatnumber value="12" type="currency" pattern="¥.00"/> <br/>
12.00元
<fmt:formatnumber value="12" type="currency" pattern="#0.00元"/> <br/>
¥12.00
<fmt:formatnumber value="12" type="currency"/> (那个货币的符号和当前web服务器的 local 设定有关)<br/>
123456.79
<fmt:formatnumber value="123456.7891" pattern="#0.00"/> <br/>
123,456.79
<fmt:formatnumber value="123456.7891" pattern="#,#00.00"/> <br/>
.79
<fmt:formatnumber value="0.7891" pattern="#.00"/> <br/>
12.34%
<fmt:formatnumber value="0.1234" type="percent" pattern="#0.00%"/><br/>
1,200%
<fmt:formatnumber value="12" type="percent" /><br/>
1200.00%
<fmt:formatnumber value="12" type="percent" pattern="#0.00%"/><br/>
上一篇: JSON教程详解