Intl.NumberFormat.prototype.resolvedOptions
Returns a new object with properties reflecting the locale and number formatting options computed during initialization
Syntax
numberFormat.resolvedOptions()Return Value
An object with resolved locale and formatting options
Examples
const fmt = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' })
const opts = fmt.resolvedOptions()
console.log(opts.locale) // 'en-US'
console.log(opts.currency) // 'USD'const fmt = new Intl.NumberFormat('de')
const { numberingSystem, locale } = fmt.resolvedOptions()
console.log(numberingSystem) // 'latn'
console.log(locale) // 'de'function getDecimalSeparator(locale: string): string {
const fmt = new Intl.NumberFormat(locale)
const parts = fmt.formatToParts(1.1)
return parts.find(p => p.type === 'decimal')?.value || '.'
}Understanding Intl.NumberFormat.prototype.resolvedOptions
The Intl.NumberFormat.prototype.resolvedOptions method in JavaScript returns a new object with properties reflecting the locale and number formatting options computed during initialization. It belongs to the Intl.NumberFormat object and is one of the most widely used methods for working with intl.numberformat values in modern JavaScript and TypeScript applications.
The method signature is numberFormat.resolvedOptions(). When called, it returns an object with resolved locale and formatting options. Understanding when and how to use resolvedOptions() helps you write more expressive, readable code.
Common use cases for Intl.NumberFormat.prototype.resolvedOptions include data transformation, input validation, API response processing, and building reusable utility functions. It works well alongside related methods like intl-numberformat, intl-numberformat-format, intl-datetimeformat, enabling you to chain operations together for complex data manipulation pipelines.
Browser support for Intl.NumberFormat.prototype.resolvedOptions is excellent across all modern browsers including Chrome, Firefox, Safari, and Edge. It is also fully supported in Node.js and Deno. For older environments, transpilation with Babel or a polyfill may be needed.
Browser Compatibility
Supported in all modern browsers (Chrome, Firefox, Safari, Edge) and Node.js. Part of the ECMAScript standard.
Related Methods
Intl.NumberFormatCreates an Intl.NumberFormat object that enables language-sensitive number formatting
Intl.NumberFormat.prototype.formatFormats a number according to the locale and formatting options of this Intl.NumberFormat object
Intl.DateTimeFormatCreates an Intl.DateTimeFormat object that enables language-sensitive date and time formatting
More Intl.NumberFormat Methods
Other methods in the Intl.NumberFormat object
Related Tools
More Intl.NumberFormat Methods
Explore JavaScript Methods
Browse our complete reference of 410 JavaScript methods with syntax, examples, and explanations.