Hi,

I just tried to switch from qjson external library to qt5 QJsonDocument and
found this:

QJsonDocument doc = QJsonDocument::fromJson("{\"user_id\":1000000}");
qDebug() << doc.toJson();

output:

"{

    "user_id": 1e+06

}

"


Any number >= 1000000 is serialized in exponential format with precision
lost. Is that harcoded limit?

In javascirpt numbers are 64-bit floating point values, the largest exact
integral value is 2^53, or 9007199254740992.

And where is option to output in compact form (without additional
whitespaces) ?

I'm using Qt 5.0 beta2 on linux. Thanks.


Best Regards

  Michal
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to