Learn R Programming

psychmeta (version 1.0.2)

add_commas: Add commas to integers Add commas to integers (e.g., convert "1000000" to "1,000,000")

Description

Add commas to integers Add commas to integers (e.g., convert "1000000" to "1,000,000")

Usage

add_commas(x, decimals = 0)

Arguments

x

Integer value

decimals

Number of decimal places to print

Value

Value with commmas.

Examples

Run this code
# NOT RUN {
add_commas(x = c(1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000))
add_commas(x = c(1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000), decimals = 2)
# }

Run the code above in your browser using DataLab