Phrases a numeric vector by rounding, separating thousands and optionally other procedures. Basically a convenience wrapper around round_to() and
base::format().
Usage
phrase_nr(
x,
round_to = 0.1,
round_up = TRUE,
big_mark = "'",
decimal_mark = ".",
justify_right = FALSE,
...
)Arguments
- x
A numeric vector to phrase.
- round_to
Number to round
xto. A numeric scalar.- round_up
Whether to round a remainder of exactly
to / 2up or not. Set toFALSEin order to round off.- big_mark
Character used between every 3 digits to separate thousands.
- decimal_mark
Character used to indicate the numeric decimal point. Only relevant if
xdoes not solely consist of integers.- justify_right
Whether to right-justify the results to a common width. See the
trimparameter ofbase::format()for details.- ...
Further arguments passed on to
base::format().
See also
Other string functions:
as_chr(),
as_comment_str(),
as_env_var_name(),
as_line_feed_chr(),
as_str(),
capitalize_first(),
dsv_colnames(),
enum_str(),
escape_lf(),
fuse_regex(),
sentenceify(),
wrap_chr()
