toLocaleString

Returns a value as a string value appropriate to the host environment's current locale.

MDN Reference


open fun toLocaleString(locales: UnicodeBCP47LocaleIdentifier, options: O = definedExternally): String(source)

Converts a value to a string by using the current or specified locale.

Parameters

locales

A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.

options

An object that contains one or more properties that specify comparison options.

MDN Reference


open fun toLocaleString(locales: Locale, options: O = definedExternally): String(source)
open fun toLocaleString(locales: ReadonlyArray<UnicodeBCP47LocaleIdentifier>, options: O = definedExternally): String(source)
open fun toLocaleString(locales: ReadonlyArray<Locale>, options: O = definedExternally): String(source)