I can not figure out how to control the output from jsonlite::toJSON() so that high precision numbers are represented as is.
For example:
l <- list(x = 1.001000000000987466525, y = 0.0000022624065747878902023)
jsonlite::toJSON(l, pretty = TRUE, digits = NA, auto_unbox = TRUE)
{
"x": 1.00100000000099,
"y": 2.26240657478789e-06
}
I would like the output of toJSON to preserve the exact value in l as follows:
{
"x": 1.001000000000987466525,
"y": 0.0000022624065747878902023
}
Can this be done?