bcat_fmt_comma: Label numbers in decimal format

View source: R/bcat_fmts.R

bcat_fmt_commaR Documentation

Label numbers in decimal format

Description

A wrapper for scales::label_comma to format a numeric vector to force decimal display of numbers with comma separators.

Usage

bcat_fmt_comma(x, accuracy = NULL, scale = 1, ...)

Arguments

x

a numeric vector

accuracy

A number to round to. Use (e.g.) 0.01 to show 2 decimal places of precision. If NULL, the default, uses a heuristic that should ensure breaks have the minimum number of digits needed to show the difference between adjacent values.

scale

A scaling factor: x will be multiplied by scale before formatting.

...

other arguments passed to label_comma

Value

A character vector of formatted decimal labels with the same length as x.

See Also

Other formatting: bcat_fmt_date(), bcat_fmt_dollar(), bcat_fmt_percent(), bcat_fmt_pvalue(), bcat_fmt_scientific()

Examples


bcat_fmt_comma(c(5000, 10000, 8000))
bcat_fmt_comma(c(5000, 10000, 8000), scale = 10e-4, accuracy = 1, suffix = "K")

Rbearcat documentation built on March 21, 2026, 5:07 p.m.