-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Function json.generate is using string.format("%g", obj) to convert numbers to strings. This has an undesired effect of mangling longer integers as follows:
obj = {session=1684119503}
json.make_object(obj)
str = json.generate(obj)String str is now {"session": 1.68412e+009}.
I wonder if it would be more appropriate to use tostring(obj), which does not have this side-effect.
Digging into the history, the "%g" conversion has been there since the initial json.lua commit by David in 2010 (r16896).
Metadata
Metadata
Assignees
Labels
No labels