Skip to contents

Format numbers to add commas to thousands

Usage

add_commas(x, ...)

Arguments

x

A list of numbers to be formatted

...

Any additional arguments

Value

A formatted list of numbers

Examples

x <- c(1000, 10000, 20000, 100, 4000)
add_commas(x)
#> [1] "1,000"  "10,000" "20,000" "100"    "4,000"