The Javascript Intl.NumberFormat resolvedOptions()
method gets settings in Intl.NumberFormat.
numberFormat.resolvedOptions()
The resulting object has the following properties:
locale
numberingSystem
notation
compactDisplay
signDisplay
useGrouping
currency
minimumIntegerDigits
maximumFractionDigits
minimumSignificantDigits
Using the resolvedOptions()
method
const numberFormat1 = new Intl.NumberFormat('de-DE'); const options1 = numberFormat1.resolvedOptions(); console.log(options1.locale);/*from w w w . ja v a 2 s. c o m*/ console.log(options1.numberingSystem); console.log(options1.style);
More example
var de = new Intl.NumberFormat('de-DE'); var usedOptions = de.resolvedOptions(); console.log(usedOptions.locale);/* w w w . j a v a 2 s . c om*/ console.log(usedOptions.numberingSystem); console.log(usedOptions.notation); console.log(usedOptions.signDisplay); console.log(usedOptions.style); console.log(usedOptions.minimumIntegerDigits); console.log(usedOptions.minimumFractionDigits); console.log(usedOptions.maximumFractionDigits); console.log(usedOptions.useGrouping);