Java – how do I format numbers in the expression language?
•
Java
How do I format and output numbers (such as long or BigDecimal) in El? For example, I want to limit some decimal numbers to 3
${result.returnValue.contract.balance}
Solution
Use < FMT: formatnumber / >
http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fmt/formatNumber.html
For example:
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <fmt:formatNumber value="${result.returnValue.contract.balance}" maxFractionDigits="3"/>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码