Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-134913

QLocale::toDouble() gives unexpected result for same decimal and grouping symbol

    XMLWordPrintable

Details

    • Windows
    • 5
    • cdcaaaeee (dev), 754666dbe (dev), ea3d2b24c (dev), d1879c3a3 (dev), 8f955142e (6.9), 18a08d81f (6.9), d94d5bcd6 (6.9), 3632b2cb4 (6.8), a09bdcf72 (6.8)
    • Foundation Sprint 127, Foundation Sprint 128

    Description

      It looks like if the same symbol (dot in this case), is used as the decimal symbol and the digit grouping symbol, then toDouble() gives different result with Qt5 and Qt6. For example, with the following code:

      bool ok;
      QLocale loc;
      double number = loc.toDouble("0.003", &ok);
      qDebug() << "LOCALE DOUBLE" << number << ok;

      Qt5 outputs:

      LOCALE DOUBLE 0.003 true

      With Qt6 you get:

      LOCALE DOUBLE 3 true

      Attachments

        For Gerrit Dashboard: QTBUG-134913
        # Subject Branch Project Status CR V

        Activity

          People

            Eddy Edward Welbourne
            tiheikka Titta Heikkala
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: