I have some dropdownbox with currency abbreviations like EUR, USD, GBP and for all the other currencies. I would like to use some c# .Net functionality/method where I can insert an currency abbreviation and it returns the currency symbol (€, $, £).
I hope someone can help me.
You can run through all cultures till you find a match:
public string GetCurrencySymbolFromAbbreviation(string abbreviation)
{
foreach (CultureInfo nfo in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
{
RegionInfo region = new RegionInfo(nfo.LCID);
if (region.ISOCurrencySymbol == abbreviation)
{
return region.CurrencySymbol;
}
}
return null;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With