2014-04-10 29 views

回答

1

试试这个办法在你的JSP:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 
    <html> 
     <head> 
     </head> 
     <body> 
      <p> 
       <c:set var="balance" value="30.0" /> 
       <fmt:parseNumber integerOnly="true" type="number" value="${balance}"/><c:out value="$"/> 
      </p> 
     </body> 
    </html> 
1
<c:set var="balance" value="30.0" /> 
<fmt:parseNumber var="i" integerOnly="true" type="number" value="${balance}$" /> 
+0

它不能正常工作的兄弟:( – Akash

+0

我是不是应该导入JSTL-api.jar文件以及 – Akash

+0

是的,你必须。 –