f_comma: Comma Format Large Integers

Description Usage Arguments Value See Also Examples

View source: R/f_comma.R

Description

Add commas to larger integers.

Usage

1
2
3
f_comma(x, mark = ",", prefix = "", ...)

ff_comma(...)

Arguments

x

A vector of numbers (or string equivalents).

mark

The character to include every n places.

prefix

A string to append to the front of elements.

...

Other arguments passed to prettyNum.

Value

Returns a comma separated string of publication ready digits.

See Also

prettyNum

Examples

1
2
3
set.seed(4)
f_comma(sample(4:10, 5)^5)
f_comma(c(1234.12345, 1234567890, .000034034, 123000000000, -1234567))

Example output

[1] "32,768"  "1,024"   "3,125"   "100,000" "7,776"  
[1] "1,234.123"       "1,234,567,890"   ".000034034"      "123,000,000,000"
[5] "-1,234,567"     

numform documentation built on Oct. 10, 2021, 1:10 a.m.