tags:

views:

128

answers:

3
+2  Q: 

Currency Library

I am looking for a .Net class/library to use with currency acronyms in the same way the TimeZoneInfo class works with timezones.

I need to populate a drop down list with these acronyms and store the result in a databse. This value will be used to retrieve up to date exchange rates from the web at a later stage.

Any ideas? :]

Thanks everyone for answering.
Dmitri - Thanks - exactly what I'm looking for.
Marc - This data entry screen will capture info for suppliers - I don't want to connect to a web service each time a supplier needs to be added.
Conrad - I want to avoid storing this info in the database.

Much appreciated!!! :-}

A: 

Well, can you query this list from the web-service that you will be using for exchange rates?

Fundamentally, it is a much simpler list than TimeZoneInfo (which has to handle lots of complexities) - a simple enum or hard-coded/database list should suffice? And it does change periodically (see: EUR).

Marc Gravell
A: 

You might be better off generating the list yourself and putting it in a database along with related information. I've used this approach fairly successfully

Country  Currency Name Symbol Code

USA  US Dollar  $ USD

There are a couple of benefits

  1. Reporting is much easier as you can join on this table and format the output as necessary
  2. Changes in the sector can be catered for
  3. Complicated scenarios such as countries supporting multiple currencies can be handled
Conrad
+3  A: 
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures);
IEnumerable<string> currencySymbols = cultures.Select<CultureInfo, string>(culture => new RegionInfo(culture.LCID).ISOCurrencySymbol);

Is it what you are looking for?

Dmitry Ornatsky