Forum: Ruby on Rails handling currencies

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2007-04-17 19:03
(Received via mailing list)
How should I handle storing money in different currencies in my
I'm using the money gem (although I can change that if anyone thinks of
better way), but when items are based in different countries, I'll want
give them different currencies.

One solution I thought of is to store everything in a primary currency
because I'm patriotic), and convert as necessary. This would mean
the conversion rates based on the number of decimal places each currency
has. So £ - $ and £ - € would be 1, whereas £ - ¥ would be 100. This
like a fairly good solution, with just a small odour of hackiness. Does
anyone have any better ideas?
unknown (Guest)
on 2007-04-17 19:12
(Received via mailing list)
Oh dear. Now I look silly for not reading things through. The money gem
supports storing multiple currencies in the database. Sorry to clog up
This topic is locked and can not be replied to.