Asp.net

Get Currency Symbol From CultureInfo Class In asp.net 4.0

Function Return the Currency Symbol

Currency = ISO3 Currency Code

Ex: Currency =”INR”

public static string CurrencySymbol(string Currency)
{
Hashtable currencySymbols = null;
string currencysymbol = “”;
if (Currency == null) return “”;
if (Currency == “”) return “”;
if (currencySymbols == null)
{
currencySymbols = new Hashtable();
foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
{
RegionInfo ri = new RegionInfo(ci.LCID);
if (!currencySymbols.ContainsKey(ri.ISOCurrencySymbol))
currencySymbols.Add(ri.ISOCurrencySymbol, ri.CurrencySymbol);
}
}
if (currencySymbols[Currency] != null)
{
currencysymbol = currencySymbols[Currency].ToString();
}
else
{
currencysymbol = Currency;
}
if (Currency == “FJD”)
{
currencysymbol = “$”;
}
if (Currency == “INR”)
{
//currencysymbol = “र”;
currencysymbol = “<img src=’Images/Rupee.png’ height=’11px’ width=’11px’ alt=’Rupee’/>”;
}
return currencysymbol;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.