반응형

string currency = "USD" 


RegionInfo
regionInfo = (from culture in CultureInfo.GetCultures(CultureTypes.InstalledWin32Cultures)

                                 where culture.Name.Length > 0
                                 let region = new RegionInfo(culture.LCID)
                                 where String.Equals(region.ISOCurrencySymbol, currency, StringComparison.InvariantCultureIgnoreCase)

string currencySymbol = regionInfo.CurrencySymbol;


if currency = "USD" Then currencySymbol = "$"
if currency = "KRW" Then currencySymbol = "₩"
.......



화폐 약자를 입력하면 해당하는 화폐 심볼 기호를 얻게 되는 코드이다.

꽤 괜찮은 코드인듯.^^/

반응형

+ Recent posts