DBK
DBK

Reputation: 403

What are the best practices with saving different currencies?

I am working in an application that handles different types of currencies. The application takes the currencies as input and converts them into USD and stores it in the database. Some data processing need to happen which creates issues with inconsistent rounding. I would like to find out the best way to handle store currencies. Is it better to store them in the native currency or store them all in one type like how the application is doing right now and display them in different currencies based on the culture?

Upvotes: 1

Views: 299

Answers (1)

Lajos Arpad
Lajos Arpad

Reputation: 76817

I would have a table

currencies(id, name, sign)

and I would make sure that there are proper conversions:

conversions(id, from_currency, to_currency, value)

You might also want to have a table with conversion histories.

Upvotes: 2

Related Questions