Learn R Programming

optiRum (version 0.41.1)

thousands_format: Thousands formatter: format number with commas separating the number thousands and suffixed with a k.

Description

Based heavily on the scales work by Hadley

Usage

thousands_format()

thousands(x)

Arguments

x

a numeric vector to format

Value

a function with single paramater x, a numeric vector, that returns a character vector

See Also

Other helper: CJ.dt(), convertToXML(), generatePDF(), pounds_format(), sanitise(), wordwrap()

Examples

Run this code
# NOT RUN {
thousands_format()(c(1, 1e3, 2000, 1e6))
thousands_format()(c(1, 1e3, 2000, 1e6))
thousands(c(1, 1e3, 2000, 1e6))
# }

Run the code above in your browser using DataLab