設置顯示時間戳
<%
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/>