Home » Developing U++ » Bugs (& fixes) » int64 in JSON
|
Re: int64 in JSON [message #47342 is a reply to message #47339] |
Thu, 05 January 2017 14:26 |
|
akebee wrote on Thu, 05 January 2017 11:33hi, the AsJSON cannot deal with int64 value,
the code
Value item_id = 6364210481850221057;
DUMP(AsJSON(item_id));
will log a double value,
how to fix it?
That is not a bug, that is a feature This is because javascript doesn't have int64. Only values less than 2^52 are supported for integers, higher numbers are converted to double (an loose precision!).
Best regards,
Honza
|
|
|
|
Re: int64 in JSON [message #47348 is a reply to message #47339] |
Thu, 05 January 2017 23:19 |
mr_ped
Messages: 825 Registered: November 2005 Location: Czech Republic - Praha
|
Experienced Contributor |
|
|
Export it as string.
{
"item_id": "6364210481850220544",
"value": "6284399068525478145",
}
Then also import as string. Then convert back to int64 (I would expect "id" to be rather uint64).
|
|
|
Goto Forum:
Current Time: Tue Apr 23 08:41:09 CEST 2024
Total time taken to generate the page: 0.02097 seconds
|