prettify_nr | R Documentation |
Prettifies a numeric vector by rounding, separating thousands and optionally other procedures. Basically a convenience wrapper around round_to()
and
base::format()
.
prettify_nr(
x,
round_to = 0.1,
round_up = TRUE,
big_mark = "'",
decimal_mark = ".",
justify_right = FALSE,
...
)
x |
A numeric vector to prettify. |
round_to |
Number to round |
round_up |
Whether to round a remainder of exactly |
big_mark |
Character used between every 3 digits to separate thousands. |
decimal_mark |
Character used to indicate the numeric decimal point. Only relevant if |
justify_right |
Whether to right-justify the results to a common width. See the |
... |
Further arguments passed on to |
A character vector of the same length as x
.
Other string functions:
as_chr()
,
as_comment_str()
,
as_line_feed_chr()
,
as_str()
,
capitalize_first()
,
dsv_colnames()
,
enum_str()
,
escape_lf()
,
fuse_regex()
,
sentenceify()
,
wrap_chr()
c(0.11, 11111.11) |> pal::prettify_nr()
c(0.11, 11111.11) |>
pal::prettify_nr(justify_right = TRUE) |>
pal::cat_lines()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.