首先加入标签库
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
具体代码
<fmt:formatNumber type="number" value="${totalPrice-clothesPrice}" maxFractionDigits="2"/>
maxFractionDigits 代表精确到小数点后 的位数
原文地址:http://blog.csdn.net/w605283073/article/details/46272381