How do I round a number in JSTL?

后端 未结 5 1537
感情败类
感情败类 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:05

    It may looks like:

    
    
    
    
     
      
      ${res}
     
     
      
      ${res}
     
    
    

    note: i think you should use mod anyway or % functionality of jstl,i use mod in example. Test,please, "expire" and "now" variables with different values, should work ok.

提交回复
热议问题