# Handling currencies

**URL:** <https://www.ruby-forum.com/t/handling-currencies/92260>\
**Category:** Rails\
**Created:** [April 17, 2007, 5:03pm UTC](https://www.ruby-forum.com/t/handling-currencies/92260 "2007-04-17T17:03:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 17, 2007, 5:03pm UTC](https://www.ruby-forum.com/t/handling-currencies/92260/1 "2007-04-17T17:03:38Z")

</div>

Hi  
How should I handle storing money in different currencies in my  
database.  
I’m using the money gem (although I can change that if anyone thinks of  
a  
better way), but when items are based in different countries, I’ll want  
to  
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  
setting  
the conversion rates based on the number of decimal places each currency  
has. So Â£ - $ and Â£ - Â€ would be 1, whereas Â£ - Â¥ would be 100. This  
seems  
like a fairly good solution, with just a small odour of hackiness. Does  
anyone have any better ideas?  
-Nathan

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 17, 2007, 5:12pm UTC](https://www.ruby-forum.com/t/handling-currencies/92260/2 "2007-04-17T17:12:39Z")

</div>

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  
the  
list.  
-N
