Learn R Programming

nima (version 0.6.2)

commas: Add Commas to a Large Number

Description

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

Usage

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

Run this code
# NOT RUN {
commas(c(2300, 9000, 21456, 987654890, 1256787, 345765, 1432))
# }

Run the code above in your browser using DataLab