Results 1 to 3 of 3

Thread: Currency symbol for current locale

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Posts
    77
    Thanks
    10
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Currency symbol for current locale

    Hi guys

    Does anyone know how to get the currency symbol for the current locale or format a money value with the correct locale currency symbol?

    Thanks
    Jeff

  2. #2
    Join Date
    Jan 2012
    Location
    Argentina
    Posts
    167
    Thanks
    33
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Currency symbol for current locale

    I just google this: currency+symbol+qtcentre...and:

    get the currency symbol only:

    QString currencySymbol = QLocale("de_CH").currencySymbol();

    get a fully formated currency string:

    QString amountOfMoney = QLocale("de_CH").currencyString(-100);


    other pages to inform yourself:

    http://doc.qt.nokia.com/4.8-snapshot...gargument.html
    http://developer.qt.nokia.com/doc/qt-4.8/qlocale.html

    hope it helps

  3. The following user says thank you to KillGabio for this useful post:

    Jeffb (2nd February 2012)

  4. #3
    Join Date
    Apr 2010
    Posts
    77
    Thanks
    10
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Currency symbol for current locale

    Thanks - I'll give it a try tomorrow.
    Just realized I am on Qt 4.7 and that is a new feature in Qt 4.8 - I'll have to upgrade.

    Cheers
    Jeff

Similar Threads

  1. Replies: 0
    Last Post: 10th May 2011, 14:58
  2. Replies: 1
    Last Post: 22nd June 2010, 19:56
  3. Currency Symbol/Sign with QLocale
    By NoRulez in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2010, 23:52
  4. Setting locale for the whole app
    By maverick_pol in forum Qt Programming
    Replies: 2
    Last Post: 22nd June 2008, 22:53
  5. MySQL currency storage problem
    By MarkoSan in forum Qt Programming
    Replies: 2
    Last Post: 15th April 2008, 09:04

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.