Currency Library [closed]
Asked Answered
L

3

7

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?

Layette answered 22/4, 2009 at 6:38 Comment(0)
L
7
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?

Leucocyte answered 22/4, 2009 at 7:34 Comment(0)
S
1

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
Sapienza answered 22/4, 2009 at 7:34 Comment(0)
E
0

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).

Elevated answered 22/4, 2009 at 6:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.