首先加入标签库
<%@ 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 代表精确到小数点后 的位数
时间: 2024-07-30 13:41:03