Simply wrapper on format... family functions of 'DT' package.
For details see: formatCurrency
The wrappers are not affecting behavior of original format... functions
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,
...
)
a table object created from datatable()
the indices of the columns to be formatted (can be character,
numeric, logical, or a formula of the form ~ V1 + V2, which is
equivalent to c('V1', 'V2'))
the currency symbol
put a marker after how many digits of the numbers
the marker after every interval decimals in the numbers
the number of decimal places to round to
a character to indicate the decimal point
whether to place the currency symbol before or after the values
the method(s) to convert a date to string in JavaScript; see
DT:::DateMethods for a list of possible methods, and
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
for a full reference
a list parameters for the specific date conversion method,
e.g., for the toLocaleDateString() method, your browser may support
params = list('ko-KR', list(year = 'numeric', month = 'long', day =
'numeric'))
string to put in front of the column values
string to put after the column values
indices of the columns from which the cell values are
obtained; this can be different with the columns argument, e.g. you
may style one column based on the values of a different column
the target to apply the CSS styles to (the current cell or the full row)
the font weight, e.g. 'bold' and 'normal'
the font color, e.g. 'red' and '#ee00aa'
the background color of table cells
the background of table cells
other CSS properties, e.g. 'border', 'font-size',
'text-align', and so on; if you want to condition CSS styles on the
cell values, you may use the helper functions such as
styleInterval(); note the actual CSS property names are
dash-separated, but you can use camelCase names in this function (otherwise
you will have to use backticks to quote the names, e.g. `font-size` =
'12px'), and this function will automatically convert camelCase names to
dash-separated names (e.g. 'fontWeight' will be converted to
'font-weight' internally)
Return formatted 'HTML' widget of 'DataTables'