JSTL格式化标签用来格式化并输出文本、日期、时间、数字。
参考:http://www.runoob.com/jsp/jsp-jstl.html
http://www.runoob.com/jsp/jstl-format-formatnumber-tag.html
引用格式化标签库的语法如下:
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:formatNumber> | 使用指定的格式或精度格式化数字 |
<fmt:parseNumber> | 解析一个代表着数字,货币或百分比的字符串 |
<fmt:formatDate> | 使用指定的风格或模式格式化日期和时间 |
<fmt:parseDate> | 解析一个代表着日期或时间的字符串 |
<fmt:bundle> | 绑定资源 |
<fmt:setLocale> | 指定地区 |
<fmt:setBundle> | 绑定资源 |
<fmt:timeZone> | 指定时区 |
<fmt:setTimeZone> | 指定时区 |
<fmt:message> | 显示资源配置文件信息 |
<fmt:requestEncoding> | 设置request的字符编码 |
eg:
<fmt:formatNumber type="number" pattern="0.00" value="${paralueSum - (paralueSum * 0.95) }" maxFractionDigits="2"/>