format_sigfig: Format numeric values by significant figures
Description
Format numeric values to print with a specified number of significant figures.
Usage
format_sigfig(sigfig, format = "xx", num_fmt = "fg")
Value
An rtables formatting function.
Arguments
sigfig
(integer(1)) number of significant figures to display.
format
(string) the format label (string) to apply when printing the value. Decimal
places in string are ignored in favor of formatting by significant figures. Formats options are:
"xx", "xx / xx", "(xx, xx)", "xx - xx", and "xx (xx)".
num_fmt
(string) numeric format modifiers to apply to the value. Defaults to "fg" for
standard significant figures formatting - fixed (non-scientific notation) format ("f")
and sigfig equal to number of significant figures instead of decimal places ("g"). See the
formatC()format argument for more options.