Playground
Browser support
Browser support
Options
Secondary Formatters
formatToParts
[
{
"type": "currency",
"value": "$"
},
{
"type": "integer",
"value": "1"
},
{
"type": "group",
"value": ","
},
{
"type": "integer",
"value": "091"
},
{
"type": "decimal",
"value": "."
},
{
"type": "fraction",
"value": "00"
}
]
formatRange
"$1,091.00 – $2,000.00"
formatRangeToParts
[
{
"type": "currency",
"value": "$",
"source": "startRange"
},
{
"type": "integer",
"value": "1",
"source": "startRange"
},
{
"type": "group",
"value": ",",
"source": "startRange"
},
{
"type": "integer",
"value": "091",
"source": "startRange"
},
{
"type": "decimal",
"value": ".",
"source": "startRange"
},
{
"type": "fraction",
"value": "00",
"source": "startRange"
},
{
"type": "literal",
"value": " – ",
"source": "shared"
},
{
"type": "currency",
"value": "$",
"source": "endRange"
},
{
"type": "integer",
"value": "2",
"source": "endRange"
},
{
"type": "group",
"value": ",",
"source": "endRange"
},
{
"type": "integer",
"value": "000",
"source": "endRange"
},
{
"type": "decimal",
"value": ".",
"source": "endRange"
},
{
"type": "fraction",
"value": "00",
"source": "endRange"
}
]
Output
"$1,091.00"
Code
new Intl.NumberFormat(undefined,
{
"style": "currency",
"currency": "USD"
})
.format(1091)
Resolved Options
{
"locale": "en-US",
"numberingSystem": "latn",
"style": "currency",
"currency": "USD",
"currencyDisplay": "symbol",
"currencySign": "standard",
"minimumIntegerDigits": 1,
"minimumFractionDigits": 2,
"maximumFractionDigits": 2,
"useGrouping": "auto",
"notation": "standard",
"signDisplay": "auto",
"roundingIncrement": 1,
"roundingMode": "halfExpand",
"roundingPriority": "auto",
"trailingZeroDisplay": "auto"
}