Intl.NumberFormat Unit
Input
Alternativ use
Intl.NumberFormat can also be used from Number.prototype.toLocaleString()
const number = 123456.789
number.toLocaleString(undefined)
123,456.789 deg
Output
unitDisplay
{
style: "unit",
unit: "degree",
unitDisplay: "long"
}
123,456.789 degrees
{
style: "unit",
unit: "degree",
unitDisplay: "short"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
unitDisplay: "narrow"
}
123,456.789°
compactDisplay
{
style: "unit",
unit: "degree",
compactDisplay: "short"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
compactDisplay: "long"
}
123,456.789 deg
notation
{
style: "unit",
unit: "degree",
notation: "standard"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
notation: "scientific"
}
1.235E5 deg
{
style: "unit",
unit: "degree",
notation: "engineering"
}
123.457E3 deg
{
style: "unit",
unit: "degree",
notation: "compact"
}
123K deg
signDisplay
{
style: "unit",
unit: "degree",
signDisplay: "auto"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
signDisplay: "never"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
signDisplay: "always"
}
+123,456.789 deg
{
style: "unit",
unit: "degree",
signDisplay: "exceptZero"
}
+123,456.789 deg
useGrouping
{
style: "unit",
unit: "degree",
useGrouping: true
}
123,456.789 deg
{
style: "unit",
unit: "degree",
useGrouping: false
}
123456.789 deg
minimumIntegerDigits
{
style: "unit",
unit: "degree",
minimumIntegerDigits: 1
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumIntegerDigits: 2
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumIntegerDigits: 3
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumIntegerDigits: 4
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumIntegerDigits: 5
}
123,456.789 deg
minimumFractionDigits
{
style: "unit",
unit: "degree",
minimumFractionDigits: 1
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumFractionDigits: 2
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumFractionDigits: 3
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumFractionDigits: 4
}
123,456.7890 deg
{
style: "unit",
unit: "degree",
minimumFractionDigits: 5
}
123,456.78900 deg
maximumFractionDigits
{
style: "unit",
unit: "degree",
maximumFractionDigits: 1
}
123,456.8 deg
{
style: "unit",
unit: "degree",
maximumFractionDigits: 2
}
123,456.79 deg
{
style: "unit",
unit: "degree",
maximumFractionDigits: 3
}
123,456.789 deg
{
style: "unit",
unit: "degree",
maximumFractionDigits: 4
}
123,456.789 deg
{
style: "unit",
unit: "degree",
maximumFractionDigits: 5
}
123,456.789 deg
minimumSignificantDigits
{
style: "unit",
unit: "degree",
minimumSignificantDigits: 1
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumSignificantDigits: 2
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumSignificantDigits: 3
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumSignificantDigits: 4
}
123,456.789 deg
{
style: "unit",
unit: "degree",
minimumSignificantDigits: 5
}
123,456.789 deg
maximumSignificantDigits
{
style: "unit",
unit: "degree",
maximumSignificantDigits: 1
}
100,000 deg
{
style: "unit",
unit: "degree",
maximumSignificantDigits: 2
}
120,000 deg
{
style: "unit",
unit: "degree",
maximumSignificantDigits: 3
}
123,000 deg
{
style: "unit",
unit: "degree",
maximumSignificantDigits: 4
}
123,500 deg
{
style: "unit",
unit: "degree",
maximumSignificantDigits: 5
}
123,460 deg
roundingIncrement
{
style: "unit",
unit: "degree",
roundingIncrement: 1
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingIncrement: 2
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 5
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 10
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 20
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 25
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 50
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 100
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 200
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 250
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 500
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 1000
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 2000
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 2500
}
maximumFractionDigits value is out of range.
{
style: "unit",
unit: "degree",
roundingIncrement: 5000
}
maximumFractionDigits value is out of range.
roundingMode
{
style: "unit",
unit: "degree",
roundingMode: "ceil"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingMode: "floor"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingMode: "expand"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingMode: "trunc"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingMode: "halfCeil"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingMode: "halfFloor"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingMode: "halfExpand"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingMode: "halfTrunc"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingMode: "halfEven"
}
123,456.789 deg
roundingPriority
{
style: "unit",
unit: "degree",
roundingPriority: "auto"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingPriority: "morePrecision"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
roundingPriority: "lessPrecision"
}
123,456.789 deg
trailingZeroDisplay
{
style: "unit",
unit: "degree",
trailingZeroDisplay: "auto"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
trailingZeroDisplay: "stripIfInteger"
}
123,456.789 deg
localeMatcher
{
style: "unit",
unit: "degree",
localeMatcher: "best fit"
}
123,456.789 deg
{
style: "unit",
unit: "degree",
localeMatcher: "lookup"
}
123,456.789 deg