NumberFormat

js.lib.intl.NumberFormat (extern class)

The NumberFormat object is a constructor for objects that enable language sensitive number formatting.

Documentation NumberFormat by Mozilla Contributors, licensed under CC-BY-SA 2.5.

Static Members

supportedLocalesOf(locales: String, ?options: Null<NumberFormatSupportedLocalesOfOptions>): Array<String>

Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.

Name Type Default
locales String
options Null<NumberFormatSupportedLocalesOfOptions> (optional)
Returns
Array<String>

Instance Members

format(number: Float): String

Getter function that formats a number according to the locale and formatting options of this NumberFormat object.

Name Type
number Float
Returns
String

formatToParts(?number: Float): Array<NumberFormatPart>

Returns an Array of objects representing the number string in parts that can be used for custom locale-aware formatting.

Name Type Default
number Float (optional)
Returns
Array<NumberFormatPart>

resolvedOptions(): NumberFormatResolvedOption

Returns a new object with properties reflecting the locale and collation options computed during initialization of the object.

Returns
NumberFormatResolvedOption

new(?locales: String, ?options: Null<NumberFormatOptions>): Void
Name Type Default
locales String (optional)
options Null<NumberFormatOptions> (optional)