Search code examples
c#currencycultureinfo

Get the currency from current culture?


Is there a way to get current information dynamically from the apps culture settings? Basically if the user has set the culture to US I want to know the currency is dollars, or if they have it set to UK I want to pound sterling etc... etc..

This is so I can send this information to PayPal when a payment is being made


Solution

  • Use the RegionInfo.ISOCurrencySymbol property. For example:

      var ri = new RegionInfo(System.Threading.Thread.CurrentThread.CurrentUICulture.LCID);
      Console.WriteLine(ri.ISOCurrencySymbol);
    

    Output: "USD"