In c ++ I used to convert an integer value to the Brazilian currency format as follows:
QLocale loc = QLocale::system();
QLocale brasil(QLocale::Portuguese);
loc.setNumberOptions(brasil.numberOptions());
QLocale::setDefault(loc);
cout << brasil.toString(orcamentoDisponivel * 0.01, 'f', 2).toStdString();
In PyQt, I did this:
# -*- coding: utf-8 -*-
from PyQt4 import QtCore
orcamentoDisponivel = 225710000
loc = QtCore.QLocale.system().name()
lang = QtCore.QLocale(loc) # ou substituir loc por 'pt_BR'
print lang.toString(int(orcamentoDisponivel * 0.01))
The problem is that while in c ++ I had output, for example: 2,257,100.00 (correct value for my case)
In python I have output: 225,710,000
Could anyone help me solve this? Thanks!