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

QString::setNum() not working properly with doubles and precision in all cases

    XMLWordPrintable

Details

    Description

      In some cases QString::setNum() may return a string that contains more number characters than the precision is set to, for instance when passing the following code

      QString str;
      str.setNum(.01234567899, 'g', 10);
      qDebug() << str;

      will print out the string "0.01234567899", while it actually should have printed out "0.012345679"

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            stormols Marius Storm-Olsen
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes