In a currency exchange rate what is the maximum number of decimal places used?

mikhail-t picture mikhail-t · May 8, 2012 · Viewed 13.2k times · Source

I need to store currency exchange rate data in the SQL 2008 database. I would like to keep rate as a decimal data type in the database.

One thing I am not sure about, is how many decimal places to give (e.g. decimal(18, ?)).

Since, I will be using this service as a source: http://openexchangerates.org/latest.json. There, it seems that the highest number of decimal places used is '6'.

Is that the right number, or there possibly can be rates with more than 6 decimal places?

Answer

Randy Minder picture Randy Minder · May 8, 2012

I once worked on an international financial C# based package, which had to support numerous currencies, and we supported 6 decimal places. We had a couple of very experienced designers who told us that would be sufficient.