Your qDebug() line is converting a double to a string in a default format (See the double version of QLocale::toString() and the source to the QDebug << operator):
double d = c.toDouble("44.48666300");
qDebug() << d;
qDebug() << c.toString(d, 'f', 10);
QLocale c(QLocale::C);
double d = c.toDouble("44.48666300");
qDebug() << d;
qDebug() << QString::number(d);
qDebug() << c.toString(d, 'f', 10);
To copy to clipboard, switch view to plain text mode
outputs:
44.4867
"44.4867"
"44.4866630000"
44.4867
"44.4867"
"44.4866630000"
To copy to clipboard, switch view to plain text mode
All the possible bits of the floating point representation of your original string are in the double. Note that this may still be an approximation due to the nature of floats.
Bookmarks