Formats fractional values as percentages with special consideration for values that round to 0 or 100, as well as missing values. The input is expected to be a fraction, which is multiplied by 100 internally before formatting. Missing values are formatted as "-".
Usage
jjcsformat_fraction(
x,
round_type = valid_round_type,
output = c("ascii", "html"),
d = 1,
add_pct = FALSE,
verbose = FALSE,
...
)Arguments
- x
(
numeric(1))
Fraction to format as a percentage (e.g.0.15represents15%.NAis formatted as"-".- round_type
(
character(1))
The type of rounding to perform. Seeformatters::format_value()for more details.- output
(
character(1))
Output type. Seeformatters::format_value()for more details.- d
(
numeric(1))
Number of digits to round the percentage to.- add_pct
(
logical(1))
Whether to append the percentage symbol ("%") to the formatted value.- verbose
(
logical(1))
Whether to print verbose output.- ...
Additional arguments passed to other methods.
See also
Other JJCS formatting functions:
count and fraction related formatting functions,
jjcsformat_xx()
