View Issue Details

IDProjectCategoryView StatusLast Update
0015358Runner[All Projects] FunctionsPublic2018-02-06 11:41
Reportercoty-crgAssigned ToRussell Kay 
PriorityMediumSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
Product Version 
Target VersionFixed in Version 
Summary0015358: json_decode() bugs with giant numbers
DescriptionSo 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

1341267758351

When I use json_decode(), in the ds_map it shows up as

1237961999

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)


TagsNo tags attached.
1.4 Found In1.99.170
2.x Runtime Found In
2.x Runtime Verified In

Activities

coty-crg

2014-07-15 06:56

Updater   ~0031099

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.

Russell Kay

2014-07-15 11:49

Manager   ~0031106

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

Russell

coty-crg

2014-07-15 17:41

Updater   ~0031113

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).

Russell Kay

2017-11-17 12:19

Manager   ~0056687

When testing use...

var a = json_decode( "[ 1341267758351 ]" );
var b = json_encode(a);
show_message(b);

Russell Kay

2017-11-17 12:27

Manager   ~0056692

Fixed in gitlab