最近在开发的过程中碰到了从后台传过来的Data数据在页面上显示时,末尾有.0存在的情况.
为了把.0进行去除,可以使用fmt标签来进行解决.
先导入fmt标签
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
如果传过来的是Date格式:
<fmt:formatDate value="${test}" type="both"/>
如果传过来的是String格式:
<fmt:parseDate value="${item.createTime}" type="both" var="test"/>
<fmt:formatDate value="${test}" type="both"/>