The division result of El expression is float.
For example, $ {8/7}, $ {6/7}, and $ {12/7} are displayed on the page as follows:
1.1428571428571428
0.8571428571428571
1.7142857142857142
Now, my goal is to only take the preceding integer. Now I use the <FMT: formatnumber/> label of the El expression, for example:
<FMT: formatnumber type = "Number" value = "$ {8/7)}" maxfractiondigits = "0"/>
The result is 1.
Maxfractiondigits = "0" indicates to retain 0 decimal places, that is, to take an integer. Note: The integer is rounded to the nearest integer.
If the result of $ {1/7} is 0 and the result of $ {6/7} is 1, this method is suitable for rounding.
Of course, to retain a fixed decimal point, you only need to modify the 0 in maxfractiondigits = "0" and change the number of digits after the decimal point.
Of course, there are also methods for rounding.
For example:
<FMT: formatnumber type = "Number" value = "$ {13-13% 7)/7)}"/>
If the result of the above method is 2, the result of this method is 1, which is obtained for different purposes.
In fact, the remainder is obtained first, and the remainder is subtracted and then divided. In this way, the result is an integer, so there is no problem of rounding. Because after the remainder is subtracted, the Division is completed. After my test, maxfractiondigits = "0" does not work anymore.