-
Notifications
You must be signed in to change notification settings - Fork 129
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
Prompt users about pillar::num() for customising the rounding of numbers #913
Comments
This will soon be even easier in pillar. I'm not sure about a startup message, perhaps we can add more links to the documentation to make this particular formatting options easier to discover? |
With pillar 1.6.2: library(tibble)
packageVersion("pillar")
#> [1] '1.6.2'
my_numbers <- c(233, 486, 565, 785)
tibble::tibble(
big = num(1000 * my_numbers + 23, extra_sigfig = TRUE),
straddle = num(my_numbers / 1000 + 100, extra_sigfig = TRUE),
straddle2 = num(my_numbers / 1000 + 1000, extra_sigfig = TRUE),
straddle3 = num(my_numbers / 10000 + 10000, extra_sigfig = TRUE),
small = num(my_numbers / 100000, extra_sigfig = TRUE)
)
#> # A tibble: 4 × 5
#> big straddle straddle2 straddle3 small
#> <num> <num> <num> <num> <num>
#> 1 233023 100.233 1000.233 10000.0233 0.00233
#> 2 486023 100.486 1000.486 10000.0486 0.00486
#> 3 565023 100.565 1000.565 10000.0565 0.00565
#> 4 785023 100.785 1000.785 10000.0785 0.00785 Created on 2021-08-01 by the reprex package (v2.0.0.9000) Now we have the following path to discover this information:
From there on it becomes a bit fuzzy. Some information is in |
Action items:
|
- Move `vignette("digits")`, `vignette("numbers")`, `?num` and `?char` from the pillar package here (#913).
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary. |
The {pillar} package has recently introduced
num()
to aid in customising how{tibble}
prints rounded numbers.There have been a few issues requesting this feature, I originally opened r-lib/pillar#97 which includes both a reprex and suggested fix r-lib/pillar#97 (comment)
Which is now controllable with
I feel it would be useful for
{tibble}
to make users aware of thenum()
functionality.Would it be possible to print a message to users on a once per session basis, specifically if
{pillar}
trims a number like100.233
to100.
?The text was updated successfully, but these errors were encountered: