Skip to content

Large numbers lose precision when decoding #29

Open
@NewPProd

Description

@NewPProd

A web service I need to use is returning the following in its JSON:
"Id":1618065507111835497

But when using this Lua library to decode it, the result is losing precision as "Id" is returned as:
1.6080655071118e+18

In this case I can't change what the webservice is providing. I'm quite happy referring the data as a string - it's just an id value.
I am limited to only using Lua 5.1.4.

Any help appreciated (e.g. pass back numbers that can't be correctly converted as strings?).

Thanks,
Rob

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions