fmat | R Documentation |
Flexible number formatter for easier formatting from numbers and dates into characters for display.
fmat(
x = NULL,
type = c("auto", ",", "$", "%", ".", "mdy", "ymd", "date", "dollar", "dollars",
"count", "percentage", "decimal"),
do.return = c("formatted", "highcharter"),
digits = NULL,
with.unit = FALSE,
do.date.sep = "/",
do.remove.spaces = FALSE,
digits.cutoff = NULL
)
x |
Vector of values to convert. If retu |
type |
Type of format to return. If do.return == 'highcharter' this is not required. |
do.return |
Information to return. "formatted" returns a vector of formatted values. |
digits |
Number of digits for rounding. If left blank, the funtion will guess at the best digits. |
with.unit |
For large numbers, choose to add a suffix for fewer characters, like M for million, etc. |
do.date.sep |
Separator for date formatting. |
do.remove.spaces |
Remove extra spaces in return. |
digits.cutoff |
Amount at which to show 0 digits. Allows for flexibility of rounding. |
Information requested via do.return.
fmat( 1000, 'dollar', digits = 2 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.