Learn R Programming

broman (version 0.84)

add_commas: Add commas to a large number

Description

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

Usage

add_commas(numbers)

Value

Character string with numbers written like "7,547,085".

Arguments

numbers

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

Examples

Run this code
add_commas(c(231, 91310, 2123, 9911001020, 999723285))

Run the code above in your browser using DataLab