Rounding of the round, floor, and ceiling numbers in freemarker
1. Simple Description
(1) round: Rounding
(2) floor: round down
(3) ceiling: rounded up
2. Examples
<# -- Rounding the round, floor, and ceiling numbers in freemarker --> <# -- round: Rounding --> <# -- floor: rounding down --> <# -- ceiling: rounded up --> <# assign numList = [12, 0.23, 89, 12.03, 69.56, 45.67,-0.56,-8.05,-89.56, 4.69]/> <# list numList as num >$ {num }? Round =$ {num? Round }? Floor =$ {num? Floor }? Ceiling =$ {num? Ceiling} </# list>
3. Sample Results
<span style="white-space:pre"></span> 12 ?round=12 ?floor=12 ?ceiling=12 0.23 ?round=0 ?floor=0 ?ceiling=1 89 ?round=89 ?floor=89 ?ceiling=89 12.03 ?round=12 ?floor=12 ?ceiling=13 69.56 ?round=70 ?floor=69 ?ceiling=70 45.67 ?round=46 ?floor=45 ?ceiling=46 -0.56 ?round=-1 ?floor=-1 ?ceiling=0 -8.05 ?round=-8 ?floor=-9 ?ceiling=-8 -89.56 ?round=-90 ?floor=-90 ?ceiling=-89 4.69 ?round=5 ?floor=4 ?ceiling=5