In a Spring MVC application using FreeMarker for rendering views, how do I force FreeMarker to always print BigDecimal values with decimal points?
For instance:
1000.12 -> 1000.12
1000 -> 1000.00
I tried
${value?string("0.##")}
This printed 1000.12 correctly as 1000.12 but 1000 still printed as 1000 instead of 1000.00.
Have you tried ${1000?string("0.00")}
?
If you need to round your numbers down use ((n * 100)?floor) / 100.0
expression