Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't emit whitespace padding around numeric data #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcheng5
Copy link

@jcheng5 jcheng5 commented Jan 5, 2015

Without this change, this is the behavior you get:

> RJSONIO::toJSON(head(cars, 3), digits = 12)
[1] "{\n \"speed\": [             4,             4,             7 ],\n\"dist\": [             2,            10,             4 ] \n}"

With this change:

> RJSONIO::toJSON(head(cars, 3), digits = 12)
[1] "{\n \"speed\": [ 4, 4, 7 ],\n\"dist\": [ 2, 10, 4 ] \n}"

The space savings are significant for many uses of Shiny and htmlwidgets.

Without this change, this is the behavior you get:

```
> RJSONIO::toJSON(head(cars, 3), digits = 12)
[1] "{\n \"speed\": [             4,             4,             7 ],\n\"dist\": [             2,            10,             4 ] \n}"
```

With this change:

```
> RJSONIO::toJSON(head(cars, 3), digits = 12)
[1] "{\n \"speed\": [ 4, 4, 7 ],\n\"dist\": [ 2, 10, 4 ] \n}"
```

The space savings are significant for many uses of Shiny and htmlwidgets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant