Intl.NumberFormat Currency
Input
Alternativ use
Intl.NumberFormat can also be used from Number.prototype.toLocaleString()
const number = 123456.789
number.toLocaleString(undefined)
€123,456.79
Output
currencySign
{
currencySign: "standard",
style: "currency",
currency: "EUR"
}
€123,456.79
{
currencySign: "accounting",
style: "currency",
currency: "EUR"
}
€123,456.79
currencyDisplay
{
currencyDisplay: "code",
style: "currency",
currency: "EUR"
}
EUR 123,456.79
{
currencyDisplay: "symbol",
style: "currency",
currency: "EUR"
}
€123,456.79
{
currencyDisplay: "narrowSymbol",
style: "currency",
currency: "EUR"
}
€123,456.79
{
currencyDisplay: "name",
style: "currency",
currency: "EUR"
}
123,456.79 euros
signDisplay
{
signDisplay: "auto",
style: "currency",
currency: "EUR"
}
€123,456.79
{
signDisplay: "never",
style: "currency",
currency: "EUR"
}
€123,456.79
{
signDisplay: "always",
style: "currency",
currency: "EUR"
}
+€123,456.79
{
signDisplay: "exceptZero",
style: "currency",
currency: "EUR"
}
+€123,456.79
useGrouping
{
useGrouping: true,
style: "currency",
currency: "EUR"
}
€123,456.79
{
useGrouping: false,
style: "currency",
currency: "EUR"
}
€123456.79
minimumIntegerDigits
{
minimumIntegerDigits: 1,
style: "currency",
currency: "EUR"
}
€123,456.79
{
minimumIntegerDigits: 2,
style: "currency",
currency: "EUR"
}
€123,456.79
{
minimumIntegerDigits: 3,
style: "currency",
currency: "EUR"
}
€123,456.79
{
minimumIntegerDigits: 4,
style: "currency",
currency: "EUR"
}
€123,456.79
{
minimumIntegerDigits: 5,
style: "currency",
currency: "EUR"
}
€123,456.79
minimumFractionDigits
{
minimumFractionDigits: 1,
style: "currency",
currency: "EUR"
}
€123,456.79
{
minimumFractionDigits: 2,
style: "currency",
currency: "EUR"
}
€123,456.79
{
minimumFractionDigits: 3,
style: "currency",
currency: "EUR"
}
€123,456.789
{
minimumFractionDigits: 4,
style: "currency",
currency: "EUR"
}
€123,456.7890
{
minimumFractionDigits: 5,
style: "currency",
currency: "EUR"
}
€123,456.78900
maximumFractionDigits
{
maximumFractionDigits: 1,
style: "currency",
currency: "EUR"
}
€123,456.8
{
maximumFractionDigits: 2,
style: "currency",
currency: "EUR"
}
€123,456.79
{
maximumFractionDigits: 3,
style: "currency",
currency: "EUR"
}
€123,456.789
{
maximumFractionDigits: 4,
style: "currency",
currency: "EUR"
}
€123,456.789
{
maximumFractionDigits: 5,
style: "currency",
currency: "EUR"
}
€123,456.789
minimumSignificantDigits
{
minimumSignificantDigits: 1,
style: "currency",
currency: "EUR"
}
€123,456.789
{
minimumSignificantDigits: 2,
style: "currency",
currency: "EUR"
}
€123,456.789
{
minimumSignificantDigits: 3,
style: "currency",
currency: "EUR"
}
€123,456.789
{
minimumSignificantDigits: 4,
style: "currency",
currency: "EUR"
}
€123,456.789
{
minimumSignificantDigits: 5,
style: "currency",
currency: "EUR"
}
€123,456.789
maximumSignificantDigits
{
maximumSignificantDigits: 1,
style: "currency",
currency: "EUR"
}
€100,000
{
maximumSignificantDigits: 2,
style: "currency",
currency: "EUR"
}
€120,000
{
maximumSignificantDigits: 3,
style: "currency",
currency: "EUR"
}
€123,000
{
maximumSignificantDigits: 4,
style: "currency",
currency: "EUR"
}
€123,500
{
maximumSignificantDigits: 5,
style: "currency",
currency: "EUR"
}
€123,460
roundingIncrement
{
roundingIncrement: 1,
style: "currency",
currency: "EUR"
}
€123,456.79
{
roundingIncrement: 2,
style: "currency",
currency: "EUR"
}
€123,456.78
{
roundingIncrement: 5,
style: "currency",
currency: "EUR"
}
€123,456.80
{
roundingIncrement: 10,
style: "currency",
currency: "EUR"
}
€123,456.80
{
roundingIncrement: 20,
style: "currency",
currency: "EUR"
}
€123,456.80
{
roundingIncrement: 25,
style: "currency",
currency: "EUR"
}
€123,456.75
{
roundingIncrement: 50,
style: "currency",
currency: "EUR"
}
€123,457.00
{
roundingIncrement: 100,
style: "currency",
currency: "EUR"
}
€123,457.00
{
roundingIncrement: 200,
style: "currency",
currency: "EUR"
}
€123,456.00
{
roundingIncrement: 250,
style: "currency",
currency: "EUR"
}
€123,457.50
{
roundingIncrement: 500,
style: "currency",
currency: "EUR"
}
€123,455.00
{
roundingIncrement: 1000,
style: "currency",
currency: "EUR"
}
€123,460.00
{
roundingIncrement: 2000,
style: "currency",
currency: "EUR"
}
€123,460.00
{
roundingIncrement: 2500,
style: "currency",
currency: "EUR"
}
€123,450.00
{
roundingIncrement: 5000,
style: "currency",
currency: "EUR"
}
€123,450.00
roundingMode
{
roundingMode: "ceil",
style: "currency",
currency: "EUR"
}
€123,456.79
{
roundingMode: "floor",
style: "currency",
currency: "EUR"
}
€123,456.78
{
roundingMode: "expand",
style: "currency",
currency: "EUR"
}
€123,456.79
{
roundingMode: "trunc",
style: "currency",
currency: "EUR"
}
€123,456.78
{
roundingMode: "halfCeil",
style: "currency",
currency: "EUR"
}
€123,456.79
{
roundingMode: "halfFloor",
style: "currency",
currency: "EUR"
}
€123,456.79
{
roundingMode: "halfExpand",
style: "currency",
currency: "EUR"
}
€123,456.79
{
roundingMode: "halfTrunc",
style: "currency",
currency: "EUR"
}
€123,456.79
{
roundingMode: "halfEven",
style: "currency",
currency: "EUR"
}
€123,456.79
roundingPriority
{
roundingPriority: "auto",
style: "currency",
currency: "EUR"
}
€123,456.79
{
roundingPriority: "morePrecision",
style: "currency",
currency: "EUR"
}
€123,456.789
{
roundingPriority: "lessPrecision",
style: "currency",
currency: "EUR"
}
€123,456.79
trailingZeroDisplay
{
trailingZeroDisplay: "auto",
style: "currency",
currency: "EUR"
}
€123,456.79
{
trailingZeroDisplay: "stripIfInteger",
style: "currency",
currency: "EUR"
}
€123,456.79
localeMatcher
{
localeMatcher: "best fit",
style: "currency",
currency: "EUR"
}
€123,456.79
{
localeMatcher: "lookup",
style: "currency",
currency: "EUR"
}
€123,456.79