Skip to content

Unable to parse JSON with -0.8999999999999999 #92

@vladaman

Description

@vladaman

Following code will throw an error:

let str = "{\"x\":-0.8999999999999999}";
console.log(JSONbig.parse(str));
/project/node_modules/json-bigint/lib/parse.js:215
            ? BigInt(string)
              ^

SyntaxError: Cannot convert 0.8999999999999999 to a BigInt
    at BigInt (<anonymous>)
    at number (/project/node_modules/json-bigint/lib/parse.js:215:15)

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