addSeparators
addSeparators(num, base, thousandsSeparator, decimalSeparator)
addSeparators(num, base, thousandsSeparator, decimalSeparator)
Formats the input number string by adding thousands and decimal separators based on the provided configuration. It allows for customizing the display of numeric values by specifying the base format, thousands separator, and decimal separator.
Arguments
num
(string
): The input number string to be formatted.base
(string
): The base format for adding separators ("", "0,0").thousandsSeparator
(string
): The character to use as the thousands separator.decimalSeparator
(string
): The character to use as the decimal separator.
Returns
(string)
: The formatted number string with separators added.
Example
Usage
Notes
The
addSeparators
function allows you to customize the display of numeric values by adding thousands and decimal separators based on the provided configuration.It supports specifying the base format, thousands separator, and decimal separator, providing flexibility in formatting numeric values.
The function returns the formatted number string with the specified separators, enhancing the readability of numerical data.
Last updated
Was this helpful?