Best Practice - Format Multiple Currencies

Klondike picture Klondike · Apr 24, 2009 · Viewed 11.9k times · Source

What is best practice for the scenario listed below?

We have an application which we would like to support multiple currencies. The software will respect the users locale and regional settings to dictate the correct number format, i.e. $10,000.00 or 10.000,00₴ etc.

We would however like to be able to format different numbers based upon a currency ID (perhaps the three letter ISO4217 code). Our idea is to store a table in the database with each currency and then request from the user to select the currency symbol which will be used. The program will then format all numbers based upon the locale/region setting but will use the currency symbol as defined in our program.

So, given the following values and currencies
10000 AUD
5989.34 USD
450 EUR

the program would output
$10,000.00
$5,989.34
€450.00

or with a regional setting that formated numbers as #####,##$ the result would be;
10000,00$
5989,34$
450,00€

Respecting locale/region number formatting but displaying different currencies, what is best practice for this?

I hope this makes sense.

Technology used is c# .NET 2.0.

Answer

Ryan picture Ryan · Jul 1, 2009

I think this Q is an excellent and clear answer as to WHAT you should be doing

SO - Proper currency format when not displaying the native currency of a culture

And this Q has a good answer of HOW to do this in C#

SO - Currency formatting