How can I make a formatted output for a number (e.g. long or BigDecimal) in EL? For example, I want to limit a number of decimal digits to 3 in
${result.returnValue.contract.balance}
How can I make a formatted output for a number (e.g. long or BigDecimal) in EL? For example, I want to limit a number of decimal digits to 3 in
${result.returnValue.contract.balance}
Using <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"/>