comma_cl: Local version of scales::comma scales::percent

View source: R/scales.R

comma_clR Documentation

Local version of scales::comma scales::percent

Description

Local version of scales::comma scales::percent

Usage

comma_cl(
  x,
  accuracy = NULL,
  scale = 1,
  prefix = "",
  suffix = "",
  big.mark = ".",
  decimal.mark = ",",
  trim = TRUE,
  digits,
  ...
)

percent_cl(
  x,
  accuracy = NULL,
  scale = 100,
  prefix = "",
  suffix = "%",
  big.mark = ".",
  decimal.mark = ",",
  trim = TRUE,
  ...
)

dollar_cl(
  x,
  accuracy = NULL,
  scale = 1,
  prefix = "$",
  suffix = "",
  big.mark = ".",
  decimal.mark = ",",
  trim = TRUE,
  largest_with_cents = 1e+05,
  negative_parens = FALSE,
  ...
)

Arguments

x

A numeric vector to format.

accuracy

NULL

scale

1

prefix

""

suffix

""

big.mark

"."

decimal.mark

","

trim

TRUE

digits

digits

...

Other arguments passed on to base::format().

largest_with_cents

largest_with_cents

negative_parens

negative_parens

Examples

x <- 10^c(1:10)

comma_cl(x)

comma_cl(x + .123, accuracy = 0.001)

comma_cl(x + .123, accuracy = 0.001, big.mark = " ")

scales::comma(x)

y <- runif(10)

percent_cl(y)

dollar_cl(x)

dollar_cl(x + .123, accuracy = 0.001)

dollar_cl(x + .123, accuracy = 0.0001, largest_with_cents = Inf)


jbkunst/kunstomverse documentation built on May 30, 2022, 12:15 a.m.