Skip to content

Behaviour of toJSON with digits=NA changed from 1.8.4 -> 1.8.5 #420

Closed
@andrjohns

Description

@andrjohns

The 1.8.5 update appears to have introduced some floating-point-ness issue when converting to JSON with max precision:

> packageVersion("jsonlite")
[1] ‘1.8.4’
> jsonlite::toJSON(list(a=c(0.1, 0.2, 0.3)), digits=NA)
{"a":[0.1,0.2,0.3]} 
> packageVersion("jsonlite")
[1] ‘1.8.5’
> jsonlite::toJSON(list(a=c(0.1, 0.2, 0.3)), digits=NA)
{"a":[0.10000000000000001,0.20000000000000001,0.29999999999999999]} 

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