formatCurrency {TT} | R Documentation |
Format table columns
Description
Simply wrapper on format... family functions of 'DT' package.
For details see: formatCurrency
The wrappers are not affecting behavior of original format... functions
Usage
formatCurrency(
table,
columns,
currency = "$",
interval = 3,
mark = ",",
digits = 2,
dec.mark = getOption("OutDec"),
before = TRUE
)
formatDate(table, columns, method = "toDateString", params = NULL)
formatPercentage(
table,
columns,
digits = 0,
interval = 3,
mark = ",",
dec.mark = getOption("OutDec")
)
formatRound(
table,
columns,
digits = 2,
interval = 3,
mark = ",",
dec.mark = getOption("OutDec")
)
formatSignif(
table,
columns,
digits = 2,
interval = 3,
mark = ",",
dec.mark = getOption("OutDec")
)
formatString(table, columns, prefix = "", suffix = "")
formatStyle(
table,
columns,
valueColumns = columns,
target = c("cell", "row"),
fontWeight = NULL,
color = NULL,
backgroundColor = NULL,
background = NULL,
...
)
Arguments
table |
a table object created from |
columns |
the indices of the columns to be formatted (can be character,
numeric, logical, or a formula of the form |
currency |
the currency symbol |
interval |
put a marker after how many digits of the numbers |
mark |
the marker after every |
digits |
the number of decimal places to round to |
dec.mark |
a character to indicate the decimal point |
before |
whether to place the currency symbol before or after the values |
method |
the method(s) to convert a date to string in JavaScript; see
|
params |
a list parameters for the specific date conversion method,
e.g., for the |
prefix |
string to put in front of the column values |
suffix |
string to put after the column values |
valueColumns |
indices of the columns from which the cell values are
obtained; this can be different with the |
target |
the target to apply the CSS styles to (the current cell or the full row) |
fontWeight |
the font weight, e.g. |
color |
the font color, e.g. |
backgroundColor |
the background color of table cells |
background |
the background of table cells |
... |
other CSS properties, e.g. |
Value
Return formatted 'HTML' widget of 'DataTables'