Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11.1
-
None
-
a9923674030980706940b3ee11145c38674bb35d (qt/qtbase/5.11)
Description
#include <QCoreApplication> #include <QLocale> #include <QString> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QLocale c(QLocale::C); bool ok; QString str = "1.7976931348623157e309"; qDebug() << c.toDouble(str, &ok) << ok; // print "inf false" return a.exec(); }
From documentation: "Returns the double represented by the localized string s, or 0.0 if the conversion failed."
In Qt4 the same code prints "0 false"
Attachments
For Gerrit Dashboard: QTBUG-71256 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
243191,7 | Change documentation of some toDouble()s to reflect reality | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |
246712,1 | Change documentation of some toDouble()s to reflect reality | 5.12 | qt/qtbase | Status: ABANDONED | 0 | 0 |