diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/snippets/qstring/main.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/doc/src/snippets/qstring/main.cpp b/doc/src/snippets/qstring/main.cpp index 48bfea9e53..d0a445731c 100644 --- a/doc/src/snippets/qstring/main.cpp +++ b/doc/src/snippets/qstring/main.cpp @@ -737,20 +737,15 @@ void Widget::toDoubleFunction() d = QString( "1234.56e-02" ).toDouble(&ok); // ok == true, d == 12.3456 //! [67] - //! [68] //! [69] - QLocale::setDefault(QLocale::C); - d = QString( "1234,56" ).toDouble(&ok); // ok == false //! [68] + d = QString( "1234,56" ).toDouble(&ok); // ok == false d = QString( "1234.56" ).toDouble(&ok); // ok == true, d == 1234.56 + //! [68] - //! [69] //! [70] - QLocale::setDefault(QLocale::German); - d = QString( "1234,56" ).toDouble(&ok); // ok == true, d == 1234.56 - d = QString( "1234.56" ).toDouble(&ok); // ok == true, d == 1234.56 - - //! [70] - QLocale::setDefault(QLocale::C); + //! [69] d = QString( "1,234,567.89" ).toDouble(&ok); // ok == false + d = QString( "1234567.89" ).toDouble(&ok); // ok == true + //! [69] } void Widget::toFloatFunction() |