0

I have to make a program in grails that have to handle money value, I would like to know if is better save in the db all the money in a unique value (ex: EUR) or if is better to save the money with the value that th user give me, and i would also like to know if exist API that convert money values.

Thank you very much anyway!

1 Answer 1

1

Have a look at timeandmoney library with grails which rightly suggests joda money to do the job.

Much more knowledgeable folks suggest using your database' bigdecimal equivalent as the underlying storage type. This implies storing it all in a "base" currency and converting on the fly. For that, you can fetch currency exchange rates from the interweb. I've seen http://grails.org/plugin/exchange-rates but haven't tried it, yet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.