Skip to content

When serializing JSON with cjson, 69.01 is serialized as 69.01000000000001. #121

@glacier-archit

Description

@glacier-archit

When serializing JSON with cjson, 69.01 is serialized as 69.01000000000001.

example:

local res = {data = 69.01} local j = require "cjson" local json = j.encode(res) ngx.say(json)

result:
{"data": 69.01000000000001}

Expected: 69.01

Actual: 69.01000000000001

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions