makeup_format_js | R Documentation |
This function creates a JavaScript function that can be used to format numbers
in Highcharts with custom prefixes and suffixes, and optionally with SI prefixes
such as "k" for kilo and "M" for mega. The function uses the which_num_format()
and guess_specifier()
functions to determine the appropriate formatting settings
based on a sample vector and locale settings.
makeup_format_js(
sample = NULL,
locale = NULL,
prefix = "",
suffix = "",
si_prefix = FALSE
)
sample |
A sample vector with the same data type and range as the data to be plotted, to use as a reference for the formatting settings. If not specified, default formatting settings will be used. |
locale |
A character string specifying the locale settings to use. If not specified, the default locale will be used. |
prefix |
A character string to prepend to each formatted value. |
suffix |
A character string to append to each formatted value. |
si_prefix |
A logical value indicating whether to use SI prefixes such as "k" and "M" to format the values. If |
A JavaScript function for formatting numbers in Highcharts.
makeup_format_js(prefix = "$", suffix = " USD")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.