Skip to content

Don't emit whitespace padding around numeric data#19

Open
jcheng5 wants to merge 1 commit intoduncantl:masterfrom
jcheng5:patch-1
Open

Don't emit whitespace padding around numeric data#19
jcheng5 wants to merge 1 commit intoduncantl:masterfrom
jcheng5:patch-1

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