Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. List of all currencies
Forum Updated to NodeBB v4.3 + New Features

List of all currencies

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HalfTough
    wrote on last edited by
    #1

    I want to write a program that will be able to link currency symbol to its ISO code. So USD and $ should be both recognized as US Dollar.

    QLocale is able to return both symbol and code for a given country, but I couldn't find a way to get list of all possible currencies or even symbol-ISO converter.

    Can this be done automatically using Qt or would I have to create list manually?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      From the top of my head, you'd have to implement a loop to go through all of QLocale's possibilities and from that generate the map you want.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      H 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        From the top of my head, you'd have to implement a loop to go through all of QLocale's possibilities and from that generate the map you want.

        H Offline
        H Offline
        HalfTough
        wrote on last edited by
        #3

        @SGaist said in List of all currencies:

        you'd have to implement a loop to go through all of QLocale's possibilities

        How do I do that though? I can't get collection of all currencies or even countries from Qlocale, so there's nothing to loop through.

        JonBJ 1 Reply Last reply
        0
        • H HalfTough

          @SGaist said in List of all currencies:

          you'd have to implement a loop to go through all of QLocale's possibilities

          How do I do that though? I can't get collection of all currencies or even countries from Qlocale, so there's nothing to loop through.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @HalfTough
          http://doc.qt.io/qt-5/qlocale.html#matchingLocales

          Getting a list of all locales: QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);

          1 Reply Last reply
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved