Standard built-ins
Intl.NumberFormat.prototype.formatRange()
Return localized display of a numeric range, possibly collapsing equal rounded endpoints. Confirm method support.
Formal Syntax & Structure
javascript syntaxjavascript
formatter.formatRange(start, end)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| start | Number | BigInt | String | Range start. |
| end | Number | BigInt | String | Range end. |
Return Value
String
Localized range text.
Working Example
Example Snippetjavascript
const f=new Intl.NumberFormat("en-US");console.log(typeof f.formatRange(1,3));