% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dt2_formats.R
\name{dt2_format_number_abbrev}
\alias{dt2_format_number_abbrev}
\title{Abbreviate large numbers with fixed decimals (k / M / B)}
\usage{
dt2_format_number_abbrev(
  options = list(),
  col_specs,
  digits = 1,
  locale = NULL
)
}
\arguments{
\item{options}{A DataTables options list to be modified.}

\item{col_specs}{Column names or 1-based indices to format.}

\item{digits}{Integer, decimal places for the abbreviated display (default 1).}

\item{locale}{Optional BCP-47 locale string (e.g. "pt-BR"). If provided,
the non-abbreviated part uses \code{toLocaleString(locale)} for grouping.}
}
\value{
The modified \code{options} list.
}
\description{
Adds a \code{columns.render} function that displays numbers as 1.2k, 3.4M, etc.
This renderer \strong{lets you control} the number of decimal places via \code{digits}.
Use this when you want a fixed, compact style independent of locale rules.
}
\examples{
opts <- list(columns = names(mtcars))
opts <- dt2_format_number_abbrev(opts, c("hp","qsec"), digits = 1, locale = "pt-BR")
}
