Converts a (possibly compound) value into a string using the format information
Source: R/format_value.R
format_value.RdConverts a (possibly compound) value into a string using the format information
Usage
format_value(
x,
format = NULL,
output = c("ascii", "html"),
na_str = "NA",
round_type = valid_round_type
)Arguments
- x
(
ANY)
the value to be formatted.- format
(
stringorfunction)
the format label (string) or formatter function to apply tox.- output
(
string)
output type.- na_str
(
character)
character vector to display when the values ofxare 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 inround_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 bothsasandiec_mod, while foriec, it will be presented as -0 (with the appropriate number of trailing zeros).