How do I round a number in JSTL?

后端 未结 5 1539
感情败类
感情败类 2020-12-29 02:39

I\'m doing a division in a JSP and I\'d like to round the result - how should I do this?

i.e.



        
5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-29 03:31

    I used:

    ${fn:substringBefore(expiry, '.')}
    

    which truncates rather than rounding, but that may be good enough.

提交回复
热议问题