JQuery EasyUI 数字格式化处理示例
内容摘要
设置显示时间戳 <% request.setAttribute("currentTimeStamp",Calendar.getInstance().getTime()); %>
显示:2009-11 <fmt:formatDate pattern="yyyy-MM" value="${current
显示:2009-11 <fmt:formatDate pattern="yyyy-MM" value="${current
文章正文
设置显示时间戳
<%
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/>
<%
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/>
代码注释