comma: Shortcut to add comma formatting

Description Usage Arguments Author(s) Examples

View source: R/comma.R

Description

Simple shortcut to make numbers into text with commas and some trailing decmimal digits. Just a shortcut to formatC.

Usage

1
comma(x, nDigits = 2)

Arguments

x

Number or vector of numbers

nDigits

Number of trailing digits. Default is 2

Author(s)

Gene Leynes

Examples

1
2
3
4
	comma(c(8987.35672, 8962.97978, 8998.06814, 8960.67199, 8997.08384))
	# [1] "8,987.36" "8,962.98" "8,998.07" "8,960.67" "8,997.08"
	comma(c(8987.35672, 8962.97978, 8998.06814, 8960.67199, 8997.08384), 0)
	# [1] "8,987" "8,963" "8,998" "8,961" "8,997"

geneorama/geneorama documentation built on Oct. 17, 2020, 12:35 a.m.