Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.3.2
-
None
-
Qt 5.3.2, Qt Creator, Mac OS X Yosemite, Open Suse Linux.
-
573f87d81363a303b7005f999a283db624201db8
Description
QJsonDocument::toJson() generate extra large text using double values.
Here is a code:
QJsonObject rootObject;
rootObject.insert("Test",0.05);
qDebug()<<QJsonDocument(rootObject).toJson(QJsonDocument::Compact);
Debug output is always:
{"Test":0.050000000000000003}I want to get compact output like this:
{"Test":0.05}If I use QJsonArray that contains a lot double values then json output is extreme large.
Is there way to make it compact? If no, than please fix it.
Attachments
Issue Links
- relates to
-
QTBUG-28560 Number type support in QJsonValue
- Closed
- resulted from
-
QTBUG-31926 Number precision in QJsonDocument.toJson() is still not enough for double
- Closed
For Gerrit Dashboard: QTBUG-42419 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
140502,3 | Use "shortest" double conversion for JSON | dev | qt/qtbase | Status: MERGED | -2 | 0 |