formatNumeric: Convert a numeric vector to character while applying pretty...

Description Usage Arguments Value See Also Examples

Description

formatNumeric converts numeric values to character and can apply various pretty formatting

Usage

1
formatNumeric(x, type, digits = 0)

Arguments

x

numeric vector on which to apply formatting/conversion

type

the type of formatting to use; valid values are "int", "dlr" and "pct"

digits

non-negative integer value indicating the number of decimal places to use

Value

A character vector of the converted/formatted numeric input.

See Also

round, trimws

Examples

1
2
3
4
5
x <- rnorm(5)
print(x)
formatNumeric(x, "pct", 1)
formatNumeric(x*10000, "int")
formatNumeric(x*10000, "dlr", digits = 2)

dnegrey/spork documentation built on May 15, 2019, 9:40 a.m.