| dt2_format_number_abbrev | R Documentation |
Adds a columns.render function that displays numbers as 1.2k, 3.4M, etc.
This renderer lets you control the number of decimal places via digits.
Use this when you want a fixed, compact style independent of locale rules.
dt2_format_number_abbrev(
options = list(),
col_specs,
digits = 1,
locale = NULL
)
options |
A DataTables options list to be modified. |
col_specs |
Column names or 1-based indices to format. |
digits |
Integer, decimal places for the abbreviated display (default 1). |
locale |
Optional BCP-47 locale string (e.g. "pt-BR"). If provided,
the non-abbreviated part uses |
The modified options list.
opts <- list(columns = names(mtcars))
opts <- dt2_format_number_abbrev(opts, c("hp","qsec"), digits = 1, locale = "pt-BR")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.