(string or function) the format label (string) or formatter function to
apply to x.
output
(string) output type.
na_str
(character) character vector to display when the values of x are missing.
If only one string is provided, it is applied for all missing values. Defaults to "NA".
round_type
(string) .
The type of rounding to perform. Allowed values: ("iec", "iec_mod" or "sas")
iec, the default, and iec_mod performs rounding compliant with IEC 60559
(see notes in round_fmt()), while
sas performs nearest-value rounding consistent with rounding within SAS.
In addition, the rounding of a negative number that rounds to zero will be presented as 0
(with the appropriate number of trailing zeros) for both sas and iec_mod,
while for iec, it will be presented as -0 (with the appropriate number of trailing zeros).
Details
A length-zero value for na_str will be interpreted as "NA".
x <- format_value(pi, format = "xx.xx")
x
format_value(x, output = "ascii")
# na_str works with multiple valuesformat_value(c(NA, 1, NA), format = "xx.x (xx.x - xx.x)", na_str = c("NE", ""))