I am using grails formatNumber and I would like to display my numbers in decimal format.
I would like to display 10 as 10.00 or 0 as 0.00 with 2 decimal digits.
how to do that ?
I believe that you were looking for how to do this with Grails' formatNumber tag
<g:formatNumber number="${10}" format="0.00"/>
<g:formatNumber number="${0}" format="0.00"/>
results in
10.00
0.00
The formatNumber tag uses DecimalFormat for the format
parameter
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