summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@digia.com>2013-07-02 13:16:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-04 16:50:57 +0200
commit94c8efff8a46c245cd4cae1e2630c608374c442d (patch)
tree14aae57185b20a98e7e85dfc9d240d5a4293777a /src/corelib
parent6e8dddadd877ec8e9a8f6006e7beaa183d5da452 (diff)
QtCore: fix the number precision in QJsonDocument.toJson() again
Need to store 17 decimal digits for binary64, IEEE 754 double formats. Autotest is included. Test cases from TC39 test suite for ECMAScript. Task-number: QTBUG-31926 Change-Id: I546398f21ea7ff5e40e89fc9de8703f628f55df9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/json/qjsonwriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/json/qjsonwriter.cpp b/src/corelib/json/qjsonwriter.cpp
index b09c6dd535..3ac16c6fd1 100644
--- a/src/corelib/json/qjsonwriter.cpp
+++ b/src/corelib/json/qjsonwriter.cpp
@@ -170,7 +170,7 @@ static void valueToJson(const QJsonPrivate::Base *b, const QJsonPrivate::Value &
json += v.toBoolean() ? "true" : "false";
break;
case QJsonValue::Double:
- json += QByteArray::number(v.toDouble(b), 'g', 13);
+ json += QByteArray::number(v.toDouble(b), 'g', 17);
break;
case QJsonValue::String:
json += '"';