Reputation: 187379
I'm using the g:formatNumber
tag to format a number as a currency
<g:formatNumber number="${it.price}" type="currency" currencyCode="${it.currency}"/>
This prints a formatted number such as
GBP6.87
is there some way that I can customise this? In particular, I would like there to be a space between the currency name and the amount, i.e.
GBP 6.87
Upvotes: 4
Views: 2103
Reputation: 27255
You can specify your own format string to be whatever you want.
<g:formatNumber number="${myNumber}" format="your format here" />
See http://grails.org/doc/latest/ref/Tags/formatNumber.html and http://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html.
Upvotes: 4