I have something like this:
<span th:text="*{a / (b + c)}"></span>
where a, b and c are integers. I need the result to be a floating point number.
Any ideas?
Actual code:
<span th:text="(*{item.candidates } > 0 and *{item.budgetSeats + item.taxSeats} > 0)?*{#numbers.formatDecimal(item.candidates / (item.budgetSeats + item.taxSeats),1,2, 'POINT')}:'N/A'">
The answer is simple:
Multiply (at least) one of the numbers with a float e.g. 1.0
.
<span th:text="*{ (a * 1.0) / (b + c)}"></span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With