formatRange()function

formatRange(from: number, to: number, options?: NumberFormatOptions): string
ParamType
fromnumber
Number at the start of the range. required
tonumber
Number at the end of the range. required
optionsNumberFormatOptions
Formatting options passed through to Intl.NumberFormat.
Return
string
Locale-formatted number range string.

Format a number range (based on the user's browser language settings).

Examples

formatRange(1, 10) // "1–10"