View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0015358||Runner||[All Projects] Functions||Public||2014-07-15 06:55||2018-02-06 11:41|
|Reporter||coty-crg||Assigned To||Russell Kay|
|Priority||Medium||Severity||C - General||Reproducibility||100%|
|Target Version||Fixed in Version|
|Summary||0015358: json_decode() bugs with giant numbers|
|Description||So after a good hour of debugging; I've finally come to the conclusion that json_decode cannot deal with large numbers.|
I have the following
When I use json_decode(), in the ds_map it shows up as
I think it has to do with the number being an int; but it's way to big to be an int. In order for my current project to work at all, it needs to be able to parse json files that are full of giant numbers like this (outside of my control)
Any way this could be patched?
|Additional Information||(using early access, but I'm assuming the bug is also present in other versions of gmstudio)|
|Tags||No tags attached.|
|1.4 Found In||1.99.170|
|2.x Runtime Found In|
|2.x Runtime Verified In|
|If it would be easier; it would be great if instead of trying to convert it to an int or double or whatever; if it would just stay as a string by default if it was that large.|
The Json library that we use only handles 32 bit integer values - I will investigate to see how much work it would be to extend it to use 64 bit integers
Thanks Russell; that's what I assumed was going on.
For now I'm just parsing the json files manually (I only needed it all displayed as a string anyways, so it works out for now).
When testing use...
var a = json_decode( "[ 1341267758351 ]" );
var b = json_encode(a);
||Fixed in gitlab|