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

Number precision in QJsonDocument.toJson() is too low

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.0.0 Beta 2, 5.0.0 RC 1
    • Fix Version/s: 5.1.0 RC1
    • Component/s: Core: Other
    • Labels:
      None
    • Commits:
      57acf1b46ca4bb670f4bf1fe3807dfa91edb6248

      Description

      Default number precision in serialization QJsonDocument to text is only 6.
      It mean's every number >= 10^6 is writed in exponential form with precision lost.
      I can't see any reason for such limit. It can mess up various IDs for example.

      Problem is in QJsonPrivate::Writer class.
      It uses QByteArray::number function with default parameters and default precision is only 6...

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              liaqi Liang Qi
              Reporter:
              dorny Michal Dorner
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes