码迷,mamicode.com
首页 > Web开发 > 详细

JSTL double保留小数点后两位

时间:2015-05-30 12:17:28      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:jstl   标签   小数点后两位   

 首先加入标签库


<%@ 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 代表精确到小数点后 的位数

JSTL double保留小数点后两位

标签:jstl   标签   小数点后两位   

原文地址:http://blog.csdn.net/w605283073/article/details/46272381

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!