This specification is developed on GitHub with the help of the ECMAScript community. There are a number of ways to contribute to the development of this specification:
Refer to the
This specification's source can be found at https://github.com/tc39/ecma402.
The ECMAScript 2018 Internationalization API Specification (ECMA-402 5th Edition), provides key language sensitive functionality as a complement to the ECMAScript 2018 Language Specification (ECMA-262 9th Edition or successor). Its functionality has been selected from that of well-established internationalization APIs such as those of the Internationalization Components for Unicode (ICU) library, of the .NET framework, or of the Java platform.
The 1st Edition API was developed by an ad-hoc group established by Ecma TC39 in September 2010 based on a proposal by Nebojša Ćirić and Jungshik Shin.
The 2nd Edition API was adopted by the General Assembly of June 2015, as a complement to the ECMAScript 6th Edition.
The 3rd Edition API was the first edition released under Ecma TC39's new yearly release cadence and open development process. A plain-text source document was built from the ECMA-402 source document to serve as the base for further development entirely on GitHub. Over the year of this standard's development, dozens of pull requests and issues were filed representing several of bug fixes, editorial fixes and other improvements. Additionally, numerous software tools were developed to aid in this effort including Ecmarkup, Ecmarkdown, and Grammarkdown.
Dozens of individuals representing many organizations have made very significant contributions within Ecma TC39 to the development of this edition and to the prior editions. In addition, a vibrant community has emerged supporting TC39's ECMAScript efforts. This community has reviewed numerous drafts, filed dozens of bug reports, performed implementation experiments, contributed test suites, and educated the world-wide developer community about ECMAScript Internationalization. Unfortunately, it is impossible to identify and acknowledge every person and organization who has contributed to this effort.
Norbert Lindenberg
ECMA-402, 1st Edition Project Editor
Rick Waldron
ECMA-402, 2nd Edition Project Editor
Caridy Patiño
ECMA-402, 3rd, 4th and 5th Editions Project Editor
This Standard defines the application programming interface for ECMAScript objects that support programs that need to adapt to the linguistic and cultural conventions used by different human languages and countries.
A conforming implementation of the ECMAScript 2018 Internationalization API Specification must conform to the ECMAScript 2018 Language Specification (ECMA-262 9th Edition, or successor), and must provide and support all the objects, properties, functions, and program semantics described in this specification.
A conforming implementation of the ECMAScript 2018 Internationalization API Specification is permitted to provide additional objects, properties, and functions beyond those described in this specification. In particular, a conforming implementation of the ECMAScript 2018 Internationalization API Specification is permitted to provide properties not described in this specification, and values for those properties, for objects that are described in this specification. A conforming implementation is not permitted to add optional arguments to the functions defined in this specification.
A conforming implementation is permitted to accept additional values, and then have implementation-defined behaviour instead of throwing a
The following referenced documents are required for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
ECMAScript 2018 Language Specification (ECMA-262 9th Edition, or successor).
https://www.ecma-international.org/publications-and-standards/standards/ecma-262/
This section contains a non-normative overview of the ECMAScript 2018 Internationalization API Specification.
Internationalization of software means designing it such that it supports or can be easily adapted to support the needs of users speaking different languages and having different cultural expectations, and enables worldwide communication between them. Localization then is the actual adaptation to a specific language and culture. Globalization of software is commonly understood to be the combination of internationalization and localization. Globalization starts at the lowest level by using a text representation that supports all languages in the world, and using standard identifiers to identify languages, countries, time zones, and other relevant parameters. It continues with using a user interface language and data presentation that the user understands, and finally often requires product-specific adaptations to the user's language, culture, and environment.
The ECMAScript 2018 Language Specification lays the foundation by using Unicode for text representation and by providing a few language-sensitive functions, but gives applications little control over the behaviour of these functions. The ECMAScript 2018 Internationalization API Specification builds on this by providing a set of customizable language-sensitive functionality. The API is useful even for applications that themselves are not internationalized, as even applications targeting only one language and one region need to properly support that one language and region. However, the API also enables applications that support multiple languages and regions, even concurrently, as may be needed in server environments.
The ECMAScript 2018 Internationalization API Specification is designed to complement the ECMAScript 2018 Language Specification by providing key language-sensitive functionality. The API can be added to an implementation of the ECMAScript 2018 Language Specification (ECMA-262 9th Edition, or successor).
The ECMAScript 2018 Internationalization API Specification provides several key pieces of language-sensitive functionality that are required in most applications: String comparison (collation), number formatting, date and time formatting, pluralization rules, and case conversion. While the ECMAScript 2018 Language Specification provides functions for this basic functionality (on Array.prototype: toLocaleString; on String.prototype: localeCompare, toLocaleLowerCase, toLocaleUpperCase; on Number.prototype: toLocaleString; on Date.prototype: toLocaleString, toLocaleDateString, and toLocaleTimeString), it leaves the actual behaviour of these functions largely up to implementations to define. The ECMAScript 2018 Internationalization API Specification provides additional functionality, control over the language and over details of the behaviour to be used, and a more complete specification of required functionality.
Applications can use the API in two ways:
The Intl object is used to package all functionality defined in the ECMAScript 2018 Internationalization API Specification to avoid name collisions.
Due to the nature of internationalization, the API specification has to leave several details implementation dependent:
ECMA 402 describes the schema of the data used by its functions. The data contained inside is implementation-dependent, and expected to change over time and vary between implementations. The variation is visible by programmers, and it is possible to construct programs which will depend on a particular output. However, this specification attempts to describe reasonable constraints which will allow well-written programs to function across implementations. Implementations are encouraged to continue their efforts to harmonize linguistic data.
This standard uses a subset of the notational conventions of the ECMAScript 2018 Language Specification (ECMA-262 9th Edition), as ES2018:
As an extension to the "a"
, then [[<s>]] denotes the field [[a]].
This specification uses blocks demarcated as Normative Optional to denote the sense of Annex B in ECMA 262. That is, normative optional sections are required when the ECMAScript host is a web browser. The content of the section is normative but optional if the ECMAScript host is not a web browser.
The following table extends the Well-Known Intrinsic Objects table defined in ES2018,
Intrinsic Name | Global Name | ECMAScript Language Association |
---|---|---|
%Date_now% | Date.now |
The initial value of the now data property of the intrinsic |
Intl |
The Intl object ( |
|
Intl.Collator |
The Intl.Collator constructor ( |
|
Intl.Collator.prototype |
The initial value of the prototype data property of the intrinsic |
|
Intl.NumberFormat |
The Intl.NumberFormat constructor ( |
|
Intl.NumberFormat.prototype |
The initial value of the prototype data property of the intrinsic |
|
Intl.DateTimeFormat |
The Intl.DateTimeFormat constructor ( |
|
Intl.DateTimeFormat.prototype |
The initial value of the prototype data property of the intrinsic |
|
Intl.PluralRules |
The Intl.PluralRules constructor ( |
|
Intl.PluralRules.prototype |
The initial value of the prototype data property of the intrinsic |
|
%StringProto_indexOf% | String.prototype.indexOf |
The initial value of the indexOf data property of the intrinsic |
This clause describes the String values used in the ECMAScript 2018 Internationalization API Specification to identify locales, currencies, and time zones.
The String values used to identify locales, currencies, and time zones are interpreted in a case-insensitive manner, treating the Unicode Basic Latin characters "A"
to "Z"
(U+0041 to U+005A) as equivalent to the corresponding Basic Latin characters "a"
to "z"
(U+0061 to U+007A). No other case folding equivalences are applied. When mapping to upper case, a mapping shall be used that maps characters in the range "a"
to "z"
(U+0061 to U+007A) to the corresponding characters in the range "A"
to "Z"
(U+0041 to U+005A) and maps no other characters to the latter range.
EXAMPLES "ß"
(U+00DF) must not match or be mapped to "SS"
(U+0053, U+0053). "ı"
(U+0131) must not match or be mapped to "I"
(U+0049).
The ECMAScript 2018 Internationalization API Specification identifies locales using language tags as defined by IETF BCP 47 (RFCs 5646 and 4647 or their successors), which may include extensions such as those registered through RFC 6067. Their canonical form is specified in RFC 5646 section 4.5 or its successor.
BCP 47 language tags that meet those validity criteria of RFC 5646 section 2.2.9 that can be verified without reference to the IANA Language Subtag Registry are considered structurally valid. All structurally valid language tags are valid for use with the APIs defined by this standard. However, the set of locales and thus language tags that an implementation supports with adequate localizations is implementation dependent. The constructors Collator, NumberFormat, DateTimeFormat, and PluralRules map the language tags used in requests to locales supported by their respective implementations.
This standard uses the term "Unicode locale extension sequence"
for any substring of a language tag that is not part of a private use subtag sequence, starts with a separator "-"
and the singleton "u"
, and includes the maximum sequence of following non-singleton subtags and their preceding "-"
separators.
The IsStructurallyValidLanguageTag abstract operation verifies that the locale argument (which must be a String value)
The abstract operation returns true if locale can be generated from the ABNF grammar in section 2.1 of the RFC, starting with Language-Tag, and does not contain duplicate variant or singleton subtags (other than as a private use subtag). It returns false otherwise. Terminal value characters in the grammar are interpreted as the Unicode equivalents of the ASCII octet values given.
The CanonicalizeLanguageTag abstract operation returns the canonical and case-regularized form of the locale argument (which must be a String value that is a structurally valid BCP 47 language tag as verified by the "extlang form"
, nor shall it reorder variant subtags.
The specifications for extensions to BCP 47 language tags, such as RFC 6067, may include canonicalization rules for the extension subtag sequences they define that go beyond the canonicalization rules of RFC 5646 section 4.5. Implementations are allowed, but not required, to apply these additional rules.
The DefaultLocale abstract operation returns a String value representing the structurally valid (
The ECMAScript 2018 Internationalization API Specification identifies currencies using 3-letter currency codes as defined by ISO 4217. Their canonical form is upper case.
All well-formed 3-letter ISO 4217 currency codes are allowed. However, the set of combinations of currency code and language tag for which localized currency symbols are available is implementation dependent. Where a localized currency symbol is not available, the ISO 4217 currency code is used for formatting.
The IsWellFormedCurrencyCode abstract operation verifies that the currency argument (which must be a String value) represents a well-formed 3-letter ISO currency code. The following steps are taken:
"A"
to "Z"
(U+0041 to U+005A), return The ECMAScript 2018 Internationalization API Specification identifies time zones using the Zone and Link names of the IANA Time Zone Database. Their canonical form is the corresponding Zone name in the casing used in the IANA Time Zone Database.
All registered Zone and Link names are allowed. Implementations must recognize all such names, and use best available current and historical information about their offsets from UTC and their daylight saving time rules in calculations. However, the set of combinations of time zone name and language tag for which localized time zone names are available is implementation dependent.
The IsValidTimeZoneName abstract operation verifies that the timeZone argument (which must be a String value) represents a valid Zone or Link name of the IANA Time Zone Database.
The abstract operation returns true if timeZone, converted to upper case as described in
The CanonicalizeTimeZoneName abstract operation returns the canonical and case-regularized form of the timeZone argument (which must be a String value that is a valid time zone name as verified by the
"backward"
file of the IANA Time Zone Database."Etc/UTC"
or "Etc/GMT"
, return "UTC"
.The Intl.DateTimeFormat constructor allows this time zone name; if the time zone is not specified, the host environment's current time zone is used. Implementations shall support UTC and the host environment's current time zone (if different from UTC) in formatting.
The DefaultTimeZone abstract operation returns a String value representing the valid (
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2018 Language Specification, 9th edition, clause
The Intl object is the %Intl% intrinsic object and the initial value of the Intl
property of the
The value of the [[Prototype]] internal slot of the Intl object is the intrinsic object
The Intl object is not a function object. It does not have a [[Construct]] internal method; it is not possible to use the Intl object as a constructor with the
The Intl object has an internal slot, [[FallbackSymbol]], which is a new "IntlLegacyConstructedSymbol"
See
See
See
See
When the getCanonicalLocales
method is called with argument locales, the following steps are taken:
The constructors for the objects providing locale sensitive services, Collator, NumberFormat, DateTimeFormat, and PluralRules, use a common pattern to negotiate the requests represented by the locales and options arguments against the actual capabilities of their implementations. The common behaviour is described here in terms of internal slots describing the capabilities and of abstract operations using these internal slots.
The constructors Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat, and Intl.PluralRules have the following internal slots:
"de-DE"
locale must include a "de"
locale that can serve as a fallback for requests such as "de-AT"
and "de-CH"
. For locales that in current usage would include a script subtag (such as Chinese locales), old-style language tags without script subtags must be included such that, for example, requests for "zh-TW"
and "zh-HK"
lead to output in traditional Chinese rather than the default simplified Chinese. The ordering of the locales within [[AvailableLocales]] is irrelevant.
EXAMPLE An implementation of DateTimeFormat might include the language tag "th"
in its [[AvailableLocales]] internal slot, and must (according to "ca"
in its [[RelevantExtensionKeys]] internal slot. For Thai, the "buddhist"
calendar is usually the default, but an implementation might also support the calendars "gregory"
, "chinese"
, and "islamicc"
for the locale "th"
. The [[LocaleData]] internal slot would therefore at least include {[[th]]: {[[ca]]: « "buddhist"
, "gregory"
, "chinese"
, "islamicc"
»}}.
Where the following abstract operations take an availableLocales argument, it must be an [[AvailableLocales]]
The abstract operation CanonicalizeLocaleList takes the following steps:
"length"
))."nan"
, which stands for Min Nan Chinese.
The BestAvailableLocale abstract operation compares the provided argument locale, which must be a String value with a structurally valid and canonicalized BCP 47 language tag, against the locales in availableLocales and returns either the longest non-empty prefix of locale that is an element of availableLocales, or
"-"
(U+002D) within candidate. If that character does not occur, return "-"
occurs at index pos-2 of candidate, decrease pos by 2.
The LookupMatcher abstract operation compares requestedLocales, which must be a
The BestFitMatcher abstract operation compares requestedLocales, which must be a
The abstract operation UnicodeExtensionValue is called with extension, which must be a Unicode locale extension sequence, and String key. This operation returns the type subtags for key by performing the following steps:
"-"
, key, and "-"
."-"
, k »)."-"
and key."u-ca-ethiopic-amete-alem-ca-ethioaa"
, "ca"
) returns "ethiopic-amete-alem"
. If the keyword for key has no type subtags, UnicodeExtensionValue returns the empty String. If extension contains no keyword for key,
The ResolveLocale abstract operation compares a BCP 47 language priority list requestedLocales against the locales in availableLocales and determines the best available language to meet the request. availableLocales, requestedLocales, and relevantExtensionKeys must be provided as
The following steps are taken:
"lookup"
, then"-u"
.""
."-"
, key, "-"
, and value."true"
, then"true"
."-x-"
»).The LookupSupportedLocales abstract operation returns the subset of the provided BCP 47 language priority list requestedLocales for which availableLocales has a matching locale when using the BCP 47 Lookup algorithm. Locales appear in the same order in the returned list as in requestedLocales. The following steps are taken:
The BestFitSupportedLocales abstract operation returns the subset of the provided BCP 47 language priority list requestedLocales for which availableLocales has a matching locale when using the Best Fit Matcher algorithm. Locales appear in the same order in the returned list as in requestedLocales. The steps taken are implementation dependent.
The SupportedLocales abstract operation returns the subset of the provided BCP 47 language priority list requestedLocales for which availableLocales has a matching locale. Two algorithms are available to match the locales: the Lookup algorithm described in RFC 4647 section 3.4, and an implementation dependent best-fit algorithm. Locales appear in the same order in the returned list as in requestedLocales. The following steps are taken:
"best fit"
."best fit"
, then
The abstract operation GetOption extracts the value of the property named property from the provided options object, converts it to the required type, checks whether it is one of a
The abstract operation DefaultNumberOption converts value to a Number value, checks whether it is in the allowed range, and fills in a fallback value if necessary.
The abstract operation GetNumberOption extracts the value of the property named property from the provided options object, converts it to a Number value, checks whether it is in the allowed range, and fills in a fallback value if necessary.
The Intl.Collator constructor is the %Collator% intrinsic object and a standard built-in property of the Intl object. Behaviour common to all service constructor properties of the Intl object is specified in
The abstract operation InitializeCollator accepts the arguments collator (which must be an object), locales, and options. It initializes collator as a
"usage"
, "string"
, « "sort"
, "search"
», "sort"
)."sort"
, then"localeMatcher"
, "string"
, « "lookup"
, "best fit"
», "best fit"
)."numeric"
, "boolean"
, "caseFirst"
, "string"
, « "upper"
, "lower"
, "false"
», "default"
."kn"
, then"true"
)."kf"
, then"sensitivity"
, "string"
, « "base"
, "accent"
, "case"
, "variant"
», "sort"
, then"variant"
."ignorePunctuation"
, "boolean"
,
When the Intl.Collator
function is called with optional arguments locales and options, the following steps are taken:
"kn"
, then"kf"
, then"%CollatorPrototype%"
, internalSlotsList).The Intl.Collator constructor has the following properties:
The value of Intl.Collator.prototype
is
This property has the attributes { [[Writable]]:
When the supportedLocalesOf
method is called, the following steps are taken:
The value of the length
property of the
The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in "co"
, may include any or all of the elements "kn"
and "kf"
, and must not include any other elements.
"co"
for collator usage and specializations, "ka"
for alternate handling, "kb"
for backward second level weight, "kc"
for case level, "kn"
for numeric, "kh"
for hiragana quaternary, "kk"
for normalization, "kf"
for case first, "kr"
for reordering, "ks"
for collation strength, and "vt"
for variable top. Collator, however, requires that the usage is specified through the usage property of the options object, alternate handling through the ignorePunctuation property of the options object, and case level and the strength through the sensitivity property of the options object. The "co"
key in the language tag is supported only for collator specializations, and the keys "kb"
, "kh"
, "kk"
, "kr"
, and "vt"
are not allowed in this version of the Internationalization API. Support for the remaining keys is implementation dependent.
The values of the [[SortLocaleData]] and [[SearchLocaleData]] internal slots are implementation defined within the constraints described in
"standard"
and "search"
must not be used as elements in any [[SortLocaleData]][locale].co and [[SearchLocaleData]][locale].co list."base"
, "accent"
, "case"
, or "variant"
for all locale values.The Intl.Collator prototype object is itself an ordinary object. %CollatorPrototype% is not an Intl.Collator instance and does not have an [[InitializedCollator]] internal slot or any of the other internal slots of Intl.Collator instance objects.
The initial value of Intl.Collator.prototype.constructor
is the intrinsic object
The initial value of the @@toStringTag property is the string value "Object"
.
This property has the attributes { [[Writable]]:
This named accessor property returns a function that compares two strings according to the sort order of this Collator object.
Intl.Collator.prototype.compare is an accessor property whose set accessor function is
Array.prototype.sort
or other functions.
A Collator compare function is an anonymous built-in function that has a [[Collator]] internal slot.
When a Collator compare function F is called with arguments x and y, the following steps are taken:
The length
property of a Collator compare function is 2.
When the CompareStrings abstract operation is called with arguments collator (which must be an object initialized as a Collator), x and y (which must be String values), it returns a Number other than
The sensitivity of collator is interpreted as follows:
If the collator is set to ignore punctuation, then strings that differ only in punctuation compare as equal.
For the interpretation of options settable through extension keys, see Unicode Technical Standard 35.
The CompareStrings abstract operation with any given collator argument, if considered as a function of the remaining two arguments x and y, must be a consistent comparison function (as defined in ES2018,
The actual return values are implementation-defined to permit implementers to encode additional information in the value. The method is required to return
This function provides access to the locale and collation options computed during initialization of the object.
Internal Slot | Property | Extension Key |
---|---|---|
[[Locale]] | "locale" |
|
[[Usage]] | "usage" |
|
[[Sensitivity]] | "sensitivity" |
|
[[IgnorePunctuation]] | "ignorePunctuation" |
|
[[Collation]] | "collation" |
|
[[Numeric]] | "numeric" |
kn |
[[CaseFirst]] | "caseFirst" |
kf |
Intl.Collator instances are ordinary objects that inherit properties from
Intl.Collator instances have an [[InitializedCollator]] internal slot.
Intl.Collator instances also have several internal slots that are computed by the constructor:
"sort"
or "search"
, identifying the collator usage."base"
, "accent"
, "case"
, or "variant"
, identifying the collator's sensitivity."type"
given in Unicode Technical Standard 35 for the collation, except that the values "standard"
and "search"
are not allowed, while the value "default"
is allowed.
Intl.Collator instances also have the following internal slots if the key corresponding to the name of the internal slot in
"upper"
, "lower"
, or "false"
.
Finally, Intl.Collator instances have a [[BoundCompare]] internal slot that caches the function returned by the compare accessor (
The abstract operation SetNumberFormatDigitOptions applies digit options used for number formatting onto the intl object.
"minimumIntegerDigits,"
, 1, 21, 1)."minimumFractionDigits"
, 0, 20, mnfdDefault)."maximumFractionDigits"
, mnfd, 20, mxfdActualDefault)."minimumSignificantDigits"
)."maximumSignificantDigits"
).The abstract operation InitializeNumberFormat accepts the arguments numberFormat (which must be an object), locales, and options. It initializes numberFormat as a NumberFormat object. The following steps are taken:
"localeMatcher"
, "string"
, « "lookup"
, "best fit"
», "best fit"
)."style"
, "string"
, « "decimal"
, "percent"
, "currency"
», "decimal"
)."currency"
, "string"
, "currency"
and currency is "currency"
, then"currencyDisplay"
, "string"
, « "code"
, "symbol"
, "name"
», "symbol"
)."currency"
, set numberFormat.[[CurrencyDisplay]] to currencyDisplay."currency"
, then"percent"
, then"useGrouping"
, "boolean"
, When the abstract operation CurrencyDigits is called with an argument currency (which must be an upper case String value), the following steps are taken:
A Number format function is an anonymous built-in function that has a [[NumberFormat]] internal slot.
When a Number format function F is called with optional argument value, the following steps are taken:
The length
property of a Number format function is 1.
The FormatNumberToString abstract operation is called with arguments intlObject (which must be an object with [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], and [[MaximumFractionDigits]] internal slots), and x (which must be a Number value), and returns x as a string value with digits formatted according to the five formatting parameters.
The PartitionNumberPattern abstract operation is called with arguments numberFormat (which must be an object initialized as a NumberFormat) and x (which must be a Number value), interprets x as a numeric value, and creates the corresponding parts according to the effective locale and the formatting options of numberFormat. The following steps are taken:
"{"
, 0 »)."}"
, beginIndex »)."literal"
, [[Value]]: literal } as the last element of result."number"
, then"nan"
, [[Value]]: n } as the last element of result."infinity"
, [[Value]]: n } as the last element of result."percent"
, let x be 100 × x."Numbering System"
column of "."
, 0 »)."integer"
, [[Value]]: integerGroup } as the last element of result."group"
, [[Value]]: groupSepSymbol } as the last element of result."integer"
, [[Value]]: integer } as the last element of result."plusSign"
, then"plusSign"
, [[Value]]: plusSignSymbol } as the last element of result."minusSign"
, then"minusSign"
, [[Value]]: minusSignSymbol } as the last element of result."percentSign"
and numberFormat.[[Style]] is "percent"
, then"percentSign"
, [[Value]]: percentSignSymbol } as the last element of result."currency"
and numberFormat.[[Style]] is "currency"
, then"code"
, "symbol"
or "name"
."code"
, then"symbol"
, then"name"
, then"currency"
, [[Value]]: cd } as the last element of result."literal"
, [[Value]]: literal } as the last element of result."{"
, nextIndex »)."literal"
, [[Value]]: literal } as the last element of result.Numbering System | Digits |
---|---|
arab | U+0660 to U+0669 |
arabext | U+06F0 to U+06F9 |
bali | U+1B50 to U+1B59 |
beng | U+09E6 to U+09EF |
deva | U+0966 to U+096F |
fullwide | U+FF10 to U+FF19 |
gujr | U+0AE6 to U+0AEF |
guru | U+0A66 to U+0A6F |
hanidec | U+3007, U+4E00, U+4E8C, U+4E09, U+56DB, U+4E94, U+516D, U+4E03, U+516B, U+4E5D |
khmr | U+17E0 to U+17E9 |
knda | U+0CE6 to U+0CEF |
laoo | U+0ED0 to U+0ED9 |
latn | U+0030 to U+0039 |
limb | U+1946 to U+194F |
mlym | U+0D66 to U+0D6F |
mong | U+1810 to U+1819 |
mymr | U+1040 to U+1049 |
orya | U+0B66 to U+0B6F |
tamldec | U+0BE6 to U+0BEF |
telu | U+0C66 to U+0C6F |
thai | U+0E50 to U+0E59 |
tibt | U+0F20 to U+0F29 |
The FormatNumber abstract operation is called with arguments numberFormat (which must be an object initialized as a NumberFormat) and x (which must be a Number value), and performs the following steps:
The FormatNumberToParts abstract operation is called with arguments numberFormat (which must be an object initialized as a NumberFormat) and x (which must be a Number value), and performs the following steps:
"type"
, part.[[Type]])."value"
, part.[[Value]]).When the ToRawPrecision abstract operation is called with arguments x (which must be a finite non-negative number), minPrecision, and maxPrecision (both must be integers between 1 and 21), the following steps are taken:
"0"
."0"
."."
, and the remaining p–(e+1) characters of m."0."
, –(e+1) occurrences of the character "0"
, and the string m."."
, and maxPrecision > minPrecision, then"0"
"."
, thenWhen the ToRawFixed abstract operation is called with arguments x (which must be a finite non-negative number), minInteger (which must be an integer between 1 and 21), minFraction, and maxFraction (which must be integers between 0 and 20), the following steps are taken:
"0"
. Otherwise, let m be the String consisting of the digits of the decimal representation of n (in order, with no leading zeroes)."0"
."."
, and b."0"
"."
, then"0"
.The UnwrapNumberFormat abstract operation gets the underlying NumberFormat operation for various methods which implement ECMA-402 v1 semantics for supporting initializing existing Intl objects.
The NumberFormat constructor is the %NumberFormat% intrinsic object and a standard built-in property of the Intl object. Behaviour common to all service constructor properties of the Intl object is specified in
When the Intl.NumberFormat
function is called with optional arguments locales and options, the following steps are taken:
"%NumberFormatPrototype%"
, « [[InitializedNumberFormat]], [[Locale]], [[NumberingSystem]], [[Style]], [[Currency]], [[CurrencyDisplay]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], [[MaximumFractionDigits]], [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[UseGrouping]], [[PositivePattern]], [[NegativePattern]], [[BoundFormat]] »).The Intl.NumberFormat constructor has the following properties:
The value of Intl.NumberFormat.prototype
is
This property has the attributes { [[Writable]]:
When the supportedLocalesOf
method is called with arguments locales and options, the following steps are taken:
The value of the length
property of the
The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in
The value of the [[RelevantExtensionKeys]] internal slot is « "nu"
».
"nu"
for numbering system and "cu"
for currency. Intl.NumberFormat, however, requires that the currency of a currency format is specified through the currency property in the options objects.
The value of the [[LocaleData]] internal slot is implementation defined within the constraints described in
"nu"
field of any locale field of [[LocaleData]] must not include the values "native"
, "traditio"
, or "finance"
."decimal"
, "percent"
, and "currency"
. Each of these fields in turn must be a record with the fields positivePattern and negativePattern. The value of these fields must be string values that must contain the substring "{number}"
and may contain the substrings "{plusSign}"
, and "{minusSign}"
; the values within the percent field must also contain the substring "{percentSign}"
; the values within the currency field must also contain the substring "{currency}"
. The pattern strings must not contain any characters in the General Category "Number, decimal digit" as specified by the Unicode Standard.The Intl.NumberFormat prototype object is itself an ordinary object. %NumberFormatPrototype% is not an Intl.NumberFormat instance and does not have an [[InitializedNumberFormat]] internal slot or any of the other internal slots of Intl.NumberFormat instance objects.
The initial value of Intl.NumberFormat.prototype.constructor
is the intrinsic object
The initial value of the @@toStringTag property is the string value "Object"
.
This property has the attributes { [[Writable]]:
Intl.NumberFormat.prototype.format is an accessor property whose set accessor function is
When the formatToParts
method is called with an optional argument value, the following steps are taken:
This function provides access to the locale and formatting options computed during initialization of the object.
Internal Slot | Property |
---|---|
[[Locale]] | "locale" |
[[NumberingSystem]] | "numberingSystem" |
[[Style]] | "style" |
[[Currency]] | "currency" |
[[CurrencyDisplay]] | "currencyDisplay" |
[[MinimumIntegerDigits]] | "minimumIntegerDigits" |
[[MinimumFractionDigits]] | "minimumFractionDigits" |
[[MaximumFractionDigits]] | "maximumFractionDigits" |
[[MinimumSignificantDigits]] | "minimumSignificantDigits" |
[[MaximumSignificantDigits]] | "maximumSignificantDigits" |
[[UseGrouping]] | "useGrouping" |
Intl.NumberFormat instances inherit properties from
Intl.NumberFormat instances have an [[InitializedNumberFormat]] internal slot.
Intl.NumberFormat instances also have several internal slots that are computed by the constructor:
"decimal"
, "currency"
, or "percent"
, identifying the number format style used."currency"
style. It is only used when [[Style]] has the value "currency"
."code"
, "symbol"
, or "name"
, specifying whether to display the currency as an ISO 4217 alphabetic currency code, a localized currency symbol, or a localized currency name if formatting with the "currency"
style. It is only used when [[Style]] has the value "currency"
.
Finally, Intl.NumberFormat instances have a [[BoundFormat]] internal slot that caches the function returned by the format accessor (
Several DateTimeFormat algorithms use values from the following table, which provides internal slots, property names and allowable values for the components of date and time formats:
Internal Slot | Property | Values |
---|---|---|
[[Weekday]] | "weekday" |
"narrow" , "short" , "long" |
[[Era]] | "era" |
"narrow" , "short" , "long" |
[[Year]] | "year" |
"2-digit" , "numeric" |
[[Month]] | "month" |
"2-digit" , "numeric" , "narrow" , "short" , "long" |
[[Day]] | "day" |
"2-digit" , "numeric" |
[[Hour]] | "hour" |
"2-digit" , "numeric" |
[[Minute]] | "minute" |
"2-digit" , "numeric" |
[[Second]] | "second" |
"2-digit" , "numeric" |
[[TimeZoneName]] | "timeZoneName" |
"short" , "long" |
The abstract operation InitializeDateTimeFormat accepts the arguments dateTimeFormat (which must be an object), locales, and options. It initializes dateTimeFormat as a DateTimeFormat object. This abstract operation functions as follows:
"any"
, "date"
)."localeMatcher"
, "string"
, « "lookup"
, "best fit"
», "best fit"
)."hour12"
, "boolean"
, "hourCycle"
, "string"
, « "h11"
, "h12"
, "h23"
, "h24"
», "timeZone"
)."string"
, « the strings given in the Values column of the row », "formatMatcher"
, "string"
, « "basic"
, "best fit"
», "best fit"
)."basic"
, then"h11"
or "h23"
, then"h11"
."h12"
."h11"
or "h23"
, then"h23"
."h24"
."h11"
or "h12"
, thenWhen the ToDateTimeOptions abstract operation is called with arguments options, required, and defaults, the following steps are taken:
"date"
or "any"
, then"weekday"
, "year"
, "month"
, "day"
, do"time"
or "any"
, then"hour"
, "minute"
, "second"
, do"date"
or "all"
, then"year"
, "month"
, "day"
, do"numeric"
)."time"
or "all"
, then"hour"
, "minute"
, "second"
, do"numeric"
).When the BasicFormatMatcher abstract operation is called with two arguments options and formats, the following steps are taken:
"2-digit"
, "numeric"
, "narrow"
, "short"
, "long"
».
When the BestFitFormatMatcher abstract operation is called with two arguments options and formats, it performs implementation dependent steps, which should return a set of component representations that a typical user of the selected locale would perceive as at least as good as the one returned by
A DateTime format function is an anonymous built-in function that has a [[DateTimeFormat]] internal slot.
When a DateTime format function F is called with optional argument date, the following steps are taken:
The length
property of a DateTime format function is 1.
The PartitionDateTimePattern abstract operation is called with arguments dateTimeFormat (which must be an object initialized as a DateTimeFormat) and x (which must be a Number value), interprets x as a
"useGrouping"
, "minimumIntegerDigits"
, 2)."useGrouping"
, "{"
, 0 »)."}"
, beginIndex »)."literal"
, [[Value]]: literal } as a new element of the list result."year"
and v ≤ 0, let v be 1 - v."month"
, increase v by 1."hour"
and dateTimeFormat.[[HourCycle]] is "h11"
or "h12"
, then"h12"
, let v be 12."hour"
and dateTimeFormat.[[HourCycle]] is "h24"
, then"numeric"
, then"2-digit"
, thenlength
property of fv is greater than 2, let fv be the substring of fv containing the last two characters."narrow"
, "short"
, or "long"
, then let fv be a String value representing f in the desired form; the String value depends upon the implementation and the effective locale and calendar of dateTimeFormat. If p is "month"
, then the String value may also depend on whether dateTimeFormat has a [[Day]] internal slot. If p is "timeZoneName"
, then the String value may also depend on the value of the [[inDST]] field of tm. If p is "era"
, then the String value may also depend on whether dateTimeFormat has a [[Era]] internal slot and if the implementation does not have a localized representation of f, then use f itself."ampm"
, then"post meridiem"
."ante meridiem"
."dayPeriod"
, [[Value]]: fv } as a new element of the list result."literal"
, [[Value]]: literal } as a new element of the list result."{"
, nextIndex »)."literal"
, [[Value]]: literal } as a new element of the list result."abbreviated"
strings for DateTimeFormat "short"
strings, and CLDR "wide"
strings for DateTimeFormat "long"
strings.
The FormatDateTime abstract operation is called with arguments dateTimeFormat (which must be an object initialized as a DateTimeFormat) and x (which must be a Number value), and performs the following steps:
The FormatDateTimeToParts abstract operation is called with arguments dateTimeFormat (which must be an object initialized as a DateTimeFormat) and x (which must be a Number value), and performs the following steps:
"type"
, part.[[Type]])."value"
, part.[[Value]]).When the ToLocalTime abstract operation is called with arguments date, calendar, and timeZone, the following steps are taken:
"gregory"
, then the calculations must match the algorithms specified in ES2018, The UnwrapDateTimeFormat abstract operation gets the underlying DateTimeFormat operation for various methods which implement ECMA-402 v1 semantics for supporting initializing existing Intl objects.
The Intl.DateTimeFormat constructor is the %DateTimeFormat% intrinsic object and a standard built-in property of the Intl object. Behaviour common to all service constructor properties of the Intl object is specified in
When the Intl.DateTimeFormat
function is called with optional arguments locales and options, the following steps are taken:
"%DateTimeFormatPrototype%"
, « [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[Weekday]], [[Era]], [[Year]], [[Month]], [[Day]], [[Hour]], [[Minute]], [[Second]], [[TimeZoneName]], [[HourCycle]], [[Pattern]], [[BoundFormat]] »).The Intl.DateTimeFormat constructor has the following properties:
The value of Intl.DateTimeFormat.prototype
is
This property has the attributes { [[Writable]]:
When the supportedLocalesOf
method is called with arguments locales and options, the following steps are taken:
The value of the length
property of the
The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in
The value of the [[RelevantExtensionKeys]] internal slot is « "ca"
, "nu"
, "hc"
».
"ca"
for calendar, "tz"
for time zone, "hc"
for hour cycle, and implicitly "nu"
for the numbering system of the number format used for numbers within the date format. DateTimeFormat, however, requires that the time zone is specified through the timeZone property in the options objects.
The value of the [[LocaleData]] internal slot is implementation defined within the constraints described in
"nu"
field of any locale field of [[LocaleData]] must not include the values "native"
, "traditio"
, or "finance"
.
"h11"
, "h12"
, "h23"
, "h24"
» for all locale values.
"h11"
, "h12"
, "h23"
, or "h24"
for all locale values.
"{"
, followed by the name of the field, followed by "}"
. If the record has an hour field, it must also have a pattern12 field, whose value is a String value that, in addition to the substrings of the pattern field, contains a substring "{ampm}"
.
EXAMPLE An implementation might include the following record as part of its English locale data: {[[hour]]: "numeric"
, [[minute]]: "2-digit"
, [[second]]: "2-digit"
, [[pattern]]: "{hour}:{minute}:{second}"
, [[pattern12]]: "{hour}:{minute}:{second} {ampm}"
}.
The Intl.DateTimeFormat prototype object is itself an ordinary object. %DateTimeFormatPrototype% is not an Intl.DateTimeFormat instance and does not have an [[InitializedDateTimeFormat]] internal slot or any of the other internal slots of Intl.DateTimeFormat instance objects.
The initial value of Intl.DateTimeFormat.prototype.constructor
is the intrinsic object
The initial value of the @@toStringTag property is the string value "Object"
.
This property has the attributes { [[Writable]]:
Intl.DateTimeFormat.prototype.format is an accessor property whose set accessor function is
Array.prototype.map
or other functions.
When the formatToParts
method is called with an argument date, the following steps are taken:
This function provides access to the locale and formatting options computed during initialization of the object.
"hour12"
, then"h11"
or "h12"
, let v be "h23"
or "h24"
, let v be Internal Slot | Property |
---|---|
[[Locale]] | "locale" |
[[Calendar]] | "calendar" |
[[NumberingSystem]] | "numberingSystem" |
[[TimeZone]] | "timeZone" |
[[HourCycle]] | "hourCycle" |
"hour12" |
|
[[Weekday]] | "weekday" |
[[Era]] | "era" |
[[Year]] | "year" |
[[Month]] | "month" |
[[Day]] | "day" |
[[Hour]] | "hour" |
[[Minute]] | "minute" |
[[Second]] | "second" |
[[TimeZoneName]] | "timeZoneName" |
For web compatibility reasons, if the property hourCycle is set, the hour12 property should be set to "h11"
or "h12"
, or to "h23"
or "h24"
.
"hour12"
property is set in addition to the "hourCycle"
property.
Intl.DateTimeFormat instances inherit properties from
Intl.DateTimeFormat instances have an [[InitializedDateTimeFormat]] internal slot.
Intl.DateTimeFormat instances also have several internal slots that are computed by the constructor:
"type"
given in Unicode Technical Standard 35 for the calendar used for formatting."type"
given in Unicode Technical Standard 35 for the numbering system used for formatting."h11"
, "h12"
) or the 24-hour format ("h23"
, "h24"
) should be used. "h11"
and "h23"
start with hour 0 and go up to 11 and 23 respectively. "h12"
and "h24"
start with hour 1 and go up to 12 and 24. [[HourCycle]] is only used when [[Hour]] is not
Finally, Intl.DateTimeFormat instances have a [[BoundFormat]] internal slot that caches the function returned by the format accessor (
The abstract operation InitializePluralRules accepts the arguments pluralRules (which must be an object), locales, and options. It initializes pluralRules as a PluralRules object. The following steps are taken:
"localeMatcher"
, "string"
, « "lookup"
, "best fit"
», "best fit"
)."type"
, "string"
, « "cardinal"
, "ordinal"
», "cardinal"
).When the GetOperands abstract operation is called with argument s, it performs the following steps:
"."
»)."0"
.Internal Slot | Type | Description |
---|---|---|
[[Number]] | Number | Absolute value of the source number (integer and decimals) |
[[IntegerDigits]] | Number | Number of digits of [[Number]]. |
[[NumberOfFractionDigits]] | Number | Number of visible fraction digits in [[Number]], with trailing zeros. |
[[NumberOfFractionDigitsWithoutTrailing]] | Number | Number of visible fraction digits in [[Number]], without trailing zeros. |
[[FractionDigits]] | Number | Number of visible fractional digits in [[Number]], with trailing zeros. |
[[FractionDigitsWithoutTrailing]] | Number | Number of visible fractional digits in [[Number]], without trailing zeros. |
When the PluralRuleSelect abstract operation is called with four arguments, it performs an implementation-dependent algorithm to map n to the appropriate plural representation of the Plural Rules Operands "other"
.
When the ResolvePlural abstract operation is called with arguments pluralRules (which must be an object initialized as a PluralRules) and n (which must be a Number value), it returns a String value representing the plural form of n according to the effective locale and the options of pluralRules. The following steps are taken:
"other"
.
The PluralRules constructor is the %PluralRules% intrinsic object and a standard built-in property of the Intl object. Behaviour common to all service constructor properties of the Intl object is specified in
When the Intl.PluralRules
function is called with optional arguments locales and options, the following steps are taken:
The Intl.PluralRules constructor has the following properties:
The value of Intl.PluralRules.prototype
is
This property has the attributes { [[Writable]]:
When the supportedLocalesOf
method is called with arguments locales and options, the following steps are taken:
The value of the length
property of the
The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in
The value of the [[RelevantExtensionKeys]] internal slot is
The value of the [[LocaleData]] internal slot is implementation defined within the constraints described in
The Intl.PluralRules prototype object is itself an ordinary object. %PluralRulesPrototype% is not an Intl.PluralRules instance and does not have an [[InitializedPluralRules]] internal slot or any of the other internal slots of Intl.PluralRules instance objects.
The initial value of Intl.PluralRules.prototype.constructor
is the intrinsic object
The initial value of the @@toStringTag property is the string value "Object"
.
This property has the attributes { [[Writable]]:
When the select
method is called with an argument value, the following steps are taken:
This function provides access to the locale and options computed during initialization of the object.
Internal Slot | Property |
---|---|
[[Locale]] | "locale" |
[[Type]] | "type" |
[[MinimumIntegerDigits]] | "minimumIntegerDigits" |
[[MinimumFractionDigits]] | "minimumFractionDigits" |
[[MaximumFractionDigits]] | "maximumFractionDigits" |
[[MinimumSignificantDigits]] | "minimumSignificantDigits" |
[[MaximumSignificantDigits]] | "maximumSignificantDigits" |
[[PluralCategories]] | "pluralCategories" |
Intl.PluralRules instances inherit properties from
Intl.PluralRules instances have an [[InitializedPluralRules]] internal slots.
Intl.PluralRules instances also have several internal slots that are computed by the constructor:
"cardinal"
or "ordinal"
, identifying the plural rules used."zero"
, "one"
, "two"
, "few"
, "many"
and "other"
, that are relevant for the locale whose localization is specified in LDML Language Plural Rules.The ECMAScript Language Specification, edition 9 or successor, describes several locale sensitive functions. An ECMAScript implementation that implements this Internationalization API Specification shall implement these functions as described here.
This definition supersedes the definition provided in ES2018,
When the localeCompare
method is called with argument that and optional arguments locales, and options, the following steps are taken:
The value of the length
property of the
localeCompare
method itself is not directly suitable as an argument to localeCompare
function is intentionally generic; it does not require that its
This definition supersedes the definition provided in ES2018,
This function interprets a string value as a sequence of code points, as described in ES2018,
"und"
.The result must be derived according to the case mappings in the Unicode character database (this explicitly includes not only the UnicodeData.txt file, but also the SpecialCasings.txt file that accompanies it).
"az"
, "lt"
, and "tr"
.
toLocaleLowerCase
function is intentionally generic; it does not require that its
This definition supersedes the definition provided in ES2018,
This function interprets a string value as a sequence of code points, as described in ES2018, String.prototype.toLocaleLowerCase
, except that characters are mapped to their uppercase equivalents as specified in the Unicode character database.
toLocaleUpperCase
function is intentionally generic; it does not require that its
The following definition(s) refer to the abstract operation thisNumberValue as defined in ES2018,
This definition supersedes the definition provided in ES2018,
When the toLocaleString
method is called with optional arguments locales and options, the following steps are taken:
The following definition(s) refer to the abstract operation
This definition supersedes the definition provided in ES2018,
When the toLocaleString
method is called with optional arguments locales and options, the following steps are taken:
"Invalid Date"
."any"
, "all"
).
This definition supersedes the definition provided in ES2018,
When the toLocaleDateString
method is called with optional arguments locales and options, the following steps are taken:
"Invalid Date"
."date"
, "date"
).
This definition supersedes the definition provided in ES2018,
When the toLocaleTimeString
method is called with optional arguments locales and options, the following steps are taken:
"Invalid Date"
."time"
, "time"
).
This definition supersedes the definition provided in ES2018,
When the toLocaleString
method is called with optional arguments locales and options, the following steps are taken:
"length"
)).toLocaleString
function is intentionally generic; it does not require that its The following aspects of the ECMAScript 2018 Internationalization API Specification are implementation dependent:
"co"
key values (collations) per locale beyond a default collation ("kn"
key values (numeric collation) per locale ("kf"
key values (case order) per locale ("nu"
key values (numbering systems) per locale ("ca"
key values (calendars) per locale ("nu"
key values (numbering systems) per locale ("gregory"
, and adjustments for local time zones and daylight saving time (This specification is authored on GitHub in a plaintext source format called Ecmarkup. Ecmarkup is an HTML and Markdown dialect that provides a framework and toolset for authoring ECMAScript specifications in plaintext and processing the specification into a full-featured HTML rendering that follows the editorial conventions for this document. Ecmarkup builds on and integrates a number of other formats and technologies including Grammarkdown for defining syntax and Ecmarkdown for authoring algorithm steps. PDF renderings of this specification are produced by printing the HTML rendering to a PDF.
Prior editions of this specification were authored using Word—the Ecmarkup source text that formed the basis of this edition was produced by converting the ECMAScript 2015 Word document to Ecmarkup using an automated conversion tool.
Ecma International
Rue du Rhone 114
CH-1204 Geneva
Tel: +41 22 849 6000
Fax: +41 22 849 6001
Web: https://ecma-international.org/
© 2018 Ecma International
This document may be copied, published and distributed to others, and certain derivative works of it may be prepared, copied, published, and distributed, in whole or in part, provided that the above copyright notice and this Copyright License and Disclaimer are included on all such copies and derivative works. The only derivative works that are permissible under this Copyright License and Disclaimer are:
(i) works which incorporate all or portion of this document for the purpose of providing commentary or explanation (such as an annotated version of the document),
(ii) works which incorporate all or portion of this document for the purpose of incorporating features that provide accessibility,
(iii) translations of this document into languages other than English and into different formats and
(iv) works by making use of this specification in standard conformant products by implementing (e.g. by copy and paste wholly or partly) the functionality therein.
However, the content of this document itself may not be modified in any way, including by removing the copyright notice or references to Ecma International, except as required to translate it into languages other than English or into a different format.
The official version of an Ecma International document is the English language version on the Ecma International website. In the event of discrepancies between a translated version and the official version, the official version shall govern.
The limited permissions granted above are perpetual and will not be revoked by Ecma International or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and ECMA INTERNATIONAL DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT https://ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.