Hi,
I'm having a problem rounding. See the following code:
...
double x = 47.785;
QString str
= l.
toString(x,
'f',
2);
qDebug() << str; // Output 47,78
QLocale::setDefault(QLocale(QLocale::Portuguese, QLocale::Brazil));
...
QLocale l;
double x = 47.785;
QString str = l.toString(x, 'f', 2);
qDebug() << str; // Output 47,78
To copy to clipboard, switch view to plain text mode
The expected result would be 47.79, is correct in not making the rounding? I noticed that he only does when rounding the third decimal place is greater than 5.
Thanks,
Marcelo E. Geyer
Bookmarks