num_comma: Numeric vector with thousands separators

View source: R/num_comma.R

num_commaR Documentation

Numeric vector with thousands separators

Description

Formats numbers with a thousand separator and a prespecified number of digits after the decimal point.

Usage

num_comma(x, digits = 2L, format = "f", big.mark = ",", ...)

parse_comma(x, digits = max(get_digits(x)), format = "f", big.mark = ",", ...)

Arguments

x

a numeric vector.

digits

an integer to indicate the number of digits of the percentage string.

format

format type passed to formatC().

big.mark

thousands separator

...

additional parameters passed to formattable().

See Also

Other numeric vectors: num_accounting(), num_currency(), num_digits(), num_percent(), num_scientific()

Examples

num_comma(1000000)
num_comma(c(1250000, 225000))
num_comma(c(1250000, 225000), format = "d")
parse_comma("123,345.123")

renkun-ken/formattable documentation built on Dec. 7, 2024, 10:19 p.m.