I'm doing a division in a JSP and I'd like to round the result - how should I do this?
i.e.
<c:set
var="expiry"
value="${(expire.time - now.time) / (60 * 1000)}"/>
...how do I round the result?
Thanks,
I'm doing a division in a JSP and I'd like to round the result - how should I do this?
i.e.
<c:set
var="expiry"
value="${(expire.time - now.time) / (60 * 1000)}"/>
...how do I round the result?
Thanks,
With the current EL version you can use
<c:set var="expiry"
value="${Math.round( (expire.time - now.time) / (60 * 1000) )}"/>
or
<c:set var="expiry"
value="${Math.floor( (expire.time - now.time) / (60 * 1000) )}"/>