I have this object:

> obj <- list(test=1.0)
> obj
$test
[1] 1

> toJSON(obj)
[1] "{\"test\":1}"

How do force the serialization of obj$test to be "1.0" instead of "1"?
I.e. the output should be:

> toJSON(obj)
[1] "{\"test\":1.0}"

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to