I'm trying to formatting a percentage using Thymeleaf. But, with a % like 99.99, thymeleaf formats this value in 100. And I don't want it.
I done this:
Java side
BigDecimal percentage = (a).multiply(new BigDecimal(100)).divide(b, 3, RoundingMode.HALF_DOWN);
Thymelaf side
th:text="${#numbers.formatDecimal(percentage, 1, 'POINT', 2, 'COMMA')}"
If percentage is 99.99 Thymeleaf gives me 100.00
Why?