Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dealing with money in Grails

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
Our domain classes use Double class to present money bids.
AFAIK, money values should be saved as BigDecimal right?
I can refactor the data type to BigDecimal (and update the database schema of course) but should I expect errors from views?
BTW, I'm using this tag to format money:
<g:formatNumber number="${equipementInstance?.cost}" type="currency" currencyCode="USD"/>
But no currency code is shown, neither delimiters.
Am I missing something?
OSX 10.6.2
Grails 1.1.1
Thanks for help and time.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a quick test I just did the following:



And my output was: $12.23

So I'm not sure what's going on, on your side of things.
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not working on Grails 1.1.1 but it does for Grails 1.2+
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Todd wrote:It is not working on Grails 1.1.1 but it does for Grails 1.2+


Time to upgrade. ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic