f: Format a value in a nice way, including rounding and trailing...

View source: R/rounding.R

fR Documentation

Format a value in a nice way, including rounding and trailing zeroes

Description

Format a value in a nice way, including rounding and trailing zeroes

Usage

f(x, dec.points = 0, ...)

Arguments

x

The value to format

dec.points

The number of decimal points

...

Arguments passed to base::format() which passes a lot of its arguments to base::pretty()

Details

Uses logical option french to determine what type of marks to use for decimal point and thousands separator. If french is not set, will use option OutDec to determine this. The value will be rounded to the number of decimal points specified, and will contain trailing zeroes if necessary so that the string has exactly the correct number of decimal points.

Value

A string representing the formatted value.

Examples

f(10000)
f(999999.1, 3)

pbs-assess/gfutilities documentation built on Sept. 18, 2023, 7:57 a.m.