commas: Add Commas to a Large Number

Description Usage Arguments Value Examples

View source: R/commas.R

Description

Convert a number to a string, with commas inserted at every 3rd digit.

Usage

1
commas(numbers)

Arguments

numbers

Vector of non-negative numbers (will be rounded to integers)

Value

Character string with numbers written like "5,771,009".

Examples

1
commas(c(2300, 9000, 21456, 987654890, 1256787, 345765, 1432))

Example output

nima: Nima Hejazi's R Toolbox
Version: 0.4.5
[1] "2,300"       "9,000"       "21,456"      "987,654,890" "1,256,787"  
[6] "345,765"     "1,432"      

nima documentation built on March 13, 2020, 2:10 a.m.

Related to commas in nima...