PDA

View Full Version : Currency symbol for current locale



Jeffb
2nd February 2012, 11:19
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

KillGabio
2nd February 2012, 11:25
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/qsystemlocale-currencytostringargument.html
http://developer.qt.nokia.com/doc/qt-4.8/qlocale.html

hope it helps

Jeffb
2nd February 2012, 13:11
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