Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Get the ISO currency code of the Device

Discussion in 'Scripting' started by xema25, Feb 21, 2016.

  1. xema25

    xema25

    Joined:
    Aug 24, 2013
    Posts:
    37
    Hi!

    I wanted to know the currency of the device.

    I tried this:


    Code (CSharp):
    1.  
    2. RegionInfo ri = new RegionInfo(System.Threading.Thread.CurrentThread.CurrentUICulture.LCID);
    3. currencyID=ri.ISOCurrencySymbol;
    But on PC it gives me USD everytime and on Android or iOS it throws an error as the given LCID is not valid. Any idea?

    Do a need to create specific methods for Android and iOS? and How?

    Thanks!
     
  2. RavenMikal

    RavenMikal

    Joined:
    Oct 18, 2014
    Posts:
    144
  3. xema25

    xema25

    Joined:
    Aug 24, 2013
    Posts:
    37
    Thanks, I saw that post too, but I would appreciate how to know that for ios and android :(
     
  4. RavenMikal

    RavenMikal

    Joined:
    Oct 18, 2014
    Posts:
    144
    No one else yet, huh? >_<

    well, how bout a look at this-

    http://stackoverflow.com/questions/3659809/where-am-i-get-country

    if you can detect the country, from there you can make a list of country/currency to run against. ^_^

    yea, totally the best I got, and I've been looking...partially because I'm working on an Android/IOS title, so I figured it would be good to know regardless. >_<