diff --git a/Makefile b/Makefile index 116c307..8883444 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,3 @@ all: ecmarkup numberformat_proposed.html numberformat_proposed_out.html + ecmarkup locales-currencies-tz.html locales-currencies-tz_out.html diff --git a/locales-currencies-tz.html b/locales-currencies-tz.html index 5259fba..9483bd7 100644 --- a/locales-currencies-tz.html +++ b/locales-currencies-tz.html @@ -172,7 +172,7 @@

Measurement Unit Identifiers

IsWellFormedUnitIdentifier ( _unitIdentifier_ )

- The IsWellFormedUnitIdentifier abstract operation verifies that the _unitIdentifier_ argument (which must be a String value) represents a well-formed UTS #35 unit identifier. The following steps are taken: + The IsWellFormedUnitIdentifier abstract operation verifies that the _unitIdentifier_ argument (which must be a String value) represents a well-formed unit identifier as defined in UTS #35, Part 2, Section 6. In addition to obeying the UTS #35 unit identifier syntax, _unitIdentifier_ must be one of the identifiers anointed in the Validity Data as described in UTS #35, Part 1, Section 3.11; the list may change over time. The following steps are taken:

@@ -180,6 +180,147 @@

IsWellFormedUnitIdentifier ( _unitIdentifier_ )

1. If _unitIdentifier_ begins or ends with `"-"`, return *false*. 1. If _unitIdentifier_ contains zero instances of `"-"`, return *false*. 1. If _unitIdentifier_ contains two `"-"` characters directly adjacent to one another, return *false*. + 1. If _unitIdentifier_ is not in the following list, return *false*. + 1. Return *true*.
diff --git a/locales-currencies-tz_out.html b/locales-currencies-tz_out.html new file mode 100644 index 0000000..777fbf6 --- /dev/null +++ b/locales-currencies-tz_out.html @@ -0,0 +1,2144 @@ + +
+

1Identification of Locales, Currencies, Time Zones, and Measurement Units

+ +

+ This clause describes the String values used in the ECMAScript 2019 Internationalization API Specification to identify locales, currencies, time zones, and measurement units. + +

+ + +

1.1Case Sensitivity and Case Mapping

+ +

+ 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). + +

+
+ + +

1.2Language Tags

+ +

+ The ECMAScript 2019 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. + +

+ + + +

1.2.1Unicode Locale Extension Sequences

+ +

+ 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. + +

+
+ + +

1.2.2IsStructurallyValidLanguageTag ( locale )

+ +

+ The IsStructurallyValidLanguageTag abstract operation verifies that the locale argument (which must be a String value) + +

+ +
    +
  • represents a well-formed BCP 47 language tag as specified in RFC 5646 section 2.1, or successor,
  • +
  • does not include duplicate variant subtags, and
  • +
  • does not include duplicate singleton subtags.
  • +
+ +

+ 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. + +

+
+ + +

1.2.3CanonicalizeLanguageTag ( locale )

+ +

+ 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 IsStructurallyValidLanguageTag abstract operation). + A conforming implementation shall take the steps specified in RFC 5646 section 4.5, or successor, to bring the language tag into canonical form, and to regularize the case of the subtags. Furthermore, a conforming implementation shall not take the steps to bring a language tag into "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. + +

+
+ + +

1.2.4DefaultLocale ()

+ +

+ The DefaultLocale abstract operation returns a String value representing the structurally valid (1.2.2) and canonicalized (1.2.3) BCP 47 language tag for the host environment's current locale. + +

+
+ +
+ + +

1.3Currency Codes

+ +

+ The ECMAScript 2019 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. + +

+ + +

1.3.1IsWellFormedCurrencyCode ( currency )

+ +

+ 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: + +

+ +
  1. Let normalized be the result of mapping currency to upper case as described in 1.1.
  2. If the number of elements in normalized is not 3, return false.
  3. If normalized contains any character that is not in the range "A" to "Z" (U+0041 to U+005A), return false.
  4. Return true. +
+
+ +
+ + +

1.4Time Zone Names

+ +

+ The ECMAScript 2019 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. + +

+ + +

1.4.1IsValidTimeZoneName ( timeZone )

+ +

+ 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 1.1, is equal to one of the Zone or Link names of the IANA Time Zone Database, converted to upper case as described in 1.1. It returns false otherwise. + +

+
+ + +

1.4.2CanonicalizeTimeZoneName

+ +

+ 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 IsValidTimeZoneName abstract operation). The following steps are taken: + +

+ +
  1. Let ianaTimeZone be the Zone or Link name of the IANA Time Zone Database such that timeZone, converted to upper case as described in 1.1, is equal to ianaTimeZone, converted to upper case as described in 1.1.
  2. If ianaTimeZone is a Link name, let ianaTimeZone be the corresponding Zone name as specified in the "backward" file of the IANA Time Zone Database.
  3. If ianaTimeZone is "Etc/UTC" or "Etc/GMT", return "UTC".
  4. Return ianaTimeZone. +
+ +

+ 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. + +

+
+ + +

1.4.3DefaultTimeZone ()

+ +

+ The DefaultTimeZone abstract operation returns a String value representing the valid (1.4.1) and canonicalized (1.4.2) time zone name for the host environment's current time zone. + +

+
+ +
+ + +

1.5Measurement Unit Identifiers

+ +

+ The ECMAScript 2019 Internationalization API Specification identifies measurement units using a unit identifier as defined by Unicode Technical Standard #35, Part 2, Section 6. Their canonical form is a string containing all lowercase letters with at least one hyphen. + +

+ +

+ All well-formed unit identifiers are allowed. However, the set of combinations of unit identifier and language tag for which localized names and symbols are available is implementation dependent. Where a localized name or symbol is not available, the unit identifier itself is used for formatting. + +

+ + +

1.5.1IsWellFormedUnitIdentifier ( unitIdentifier )

+ +

+ The IsWellFormedUnitIdentifier abstract operation verifies that the unitIdentifier argument (which must be a String value) represents a well-formed unit identifier as defined in UTS #35, Part 2, Section 6. In addition to obeying the UTS #35 unit identifier syntax, unitIdentifier must be one of the identifiers anointed in the Validity Data as described in UTS #35, Part 1, Section 3.11; the list may change over time. The following steps are taken: + +

+ +
  1. If unitIdentifier contains any character that is not in the range "a" to "z" (U+0061 to U+007A) and is not "-" (U+002D), return false.
  2. If unitIdentifier begins or ends with "-", return false.
  3. If unitIdentifier contains zero instances of "-", return false.
  4. If unitIdentifier contains two "-" characters directly adjacent to one another, return false.
  5. If unitIdentifier is not in the following list, return false. +
      +
    • acceleration-g-force
    • +
    • acceleration-meter-per-second-squared
    • +
    • angle-arc-minute
    • +
    • angle-arc-second
    • +
    • angle-degree
    • +
    • angle-radian
    • +
    • angle-revolution
    • +
    • area-acre
    • +
    • area-hectare
    • +
    • area-square-centimeter
    • +
    • area-square-foot
    • +
    • area-square-inch
    • +
    • area-square-kilometer
    • +
    • area-square-meter
    • +
    • area-square-mile
    • +
    • area-square-yard
    • +
    • concentr-karat
    • +
    • concentr-milligram-per-deciliter
    • +
    • concentr-millimole-per-liter
    • +
    • concentr-part-per-million
    • +
    • consumption-liter-per-100kilometers
    • +
    • consumption-liter-per-kilometer
    • +
    • consumption-mile-per-gallon
    • +
    • consumption-mile-per-gallon-imperial
    • +
    • digital-bit
    • +
    • digital-byte
    • +
    • digital-gigabit
    • +
    • digital-gigabyte
    • +
    • digital-kilobit
    • +
    • digital-kilobyte
    • +
    • digital-megabit
    • +
    • digital-megabyte
    • +
    • digital-terabit
    • +
    • digital-terabyte
    • +
    • duration-century
    • +
    • duration-day
    • +
    • duration-day-person
    • +
    • duration-hour
    • +
    • duration-microsecond
    • +
    • duration-millisecond
    • +
    • duration-minute
    • +
    • duration-month
    • +
    • duration-month-person
    • +
    • duration-nanosecond
    • +
    • duration-second
    • +
    • duration-week
    • +
    • duration-week-person
    • +
    • duration-year
    • +
    • duration-year-person
    • +
    • electric-ampere
    • +
    • electric-milliampere
    • +
    • electric-ohm
    • +
    • electric-volt
    • +
    • energy-calorie
    • +
    • energy-foodcalorie
    • +
    • energy-joule
    • +
    • energy-kilocalorie
    • +
    • energy-kilojoule
    • +
    • energy-kilowatt-hour
    • +
    • frequency-gigahertz
    • +
    • frequency-hertz
    • +
    • frequency-kilohertz
    • +
    • frequency-megahertz
    • +
    • length-astronomical-unit
    • +
    • length-centimeter
    • +
    • length-decimeter
    • +
    • length-fathom
    • +
    • length-foot
    • +
    • length-furlong
    • +
    • length-inch
    • +
    • length-kilometer
    • +
    • length-light-year
    • +
    • length-meter
    • +
    • length-micrometer
    • +
    • length-mile
    • +
    • length-mile-scandinavian
    • +
    • length-millimeter
    • +
    • length-nanometer
    • +
    • length-nautical-mile
    • +
    • length-parsec
    • +
    • length-picometer
    • +
    • length-yard
    • +
    • light-lux
    • +
    • mass-carat
    • +
    • mass-gram
    • +
    • mass-kilogram
    • +
    • mass-metric-ton
    • +
    • mass-microgram
    • +
    • mass-milligram
    • +
    • mass-ounce
    • +
    • mass-ounce-troy
    • +
    • mass-pound
    • +
    • mass-stone
    • +
    • mass-ton
    • +
    • power-gigawatt
    • +
    • power-horsepower
    • +
    • power-kilowatt
    • +
    • power-megawatt
    • +
    • power-milliwatt
    • +
    • power-watt
    • +
    • pressure-hectopascal
    • +
    • pressure-inch-hg
    • +
    • pressure-millibar
    • +
    • pressure-millimeter-of-mercury
    • +
    • pressure-pound-per-square-inch
    • +
    • speed-kilometer-per-hour
    • +
    • speed-knot
    • +
    • speed-meter-per-second
    • +
    • speed-mile-per-hour
    • +
    • temperature-celsius
    • +
    • temperature-fahrenheit
    • +
    • temperature-generic
    • +
    • temperature-kelvin
    • +
    • volume-acre-foot
    • +
    • volume-bushel
    • +
    • volume-centiliter
    • +
    • volume-cubic-centimeter
    • +
    • volume-cubic-foot
    • +
    • volume-cubic-inch
    • +
    • volume-cubic-kilometer
    • +
    • volume-cubic-meter
    • +
    • volume-cubic-mile
    • +
    • volume-cubic-yard
    • +
    • volume-cup
    • +
    • volume-cup-metric
    • +
    • volume-deciliter
    • +
    • volume-fluid-ounce
    • +
    • volume-gallon
    • +
    • volume-gallon-imperial
    • +
    • volume-hectoliter
    • +
    • volume-liter
    • +
    • volume-megaliter
    • +
    • volume-milliliter
    • +
    • volume-pint
    • +
    • volume-pint-metric
    • +
    • volume-quart
    • +
    • volume-tablespoon
    • +
    • volume-teaspoon
    • +
  6. Return true. +
+
+ +
+ +
+
\ No newline at end of file diff --git a/numberformat_proposed.html b/numberformat_proposed.html index a5cbfb8..da98ff5 100644 --- a/numberformat_proposed.html +++ b/numberformat_proposed.html @@ -245,15 +245,15 @@

PartitionNumberPattern ( _numberFormat_, _x_ )

1. Append a new Record { [[Type]]: `"percentSign"`, [[Value]]: _percentSignSymbol_ } as the last element of _result_. 1. Else if _p_ is equal `"measureUnitSymbol"` and _numberFormat_.[[UnitType]] is `"measureUnit"`, then 1. Let _measureUnit_ be _numberFormat_.[[MeasureUnit]]. - 1. Let _mu_ be an ILD string representing _measureUnit_ in short form, which may depend on _x_ in languages having different plural forms. If the implementation does not have such a representation of _measureUnit_, use _measureUnit_ itself. + 1. Let _mu_ be an ILD string representing _measureUnit_ in short form, which may depend on _x_ in languages having different plural forms. 1. Append a new Record { [[Type]]: `"unit"`, [[Value]]: _mu_ } as the last element of _result_. 1. Else if _p_ is equal `"measureUnitNarrowSymbol"` and _numberFormat_.[[UnitType]] is `"measureUnit"`, then 1. Let _measureUnit_ be _numberFormat_.[[MeasureUnit]]. - 1. Let _mu_ be an ILD string representing _measureUnit_ in narrow form, which may depend on _x_ in languages having different plural forms. If the implementation does not have such a representation of _measureUnit_, use _measureUnit_ itself. + 1. Let _mu_ be an ILD string representing _measureUnit_ in narrow form, which may depend on _x_ in languages having different plural forms. 1. Append a new Record { [[Type]]: `"unit"`, [[Value]]: _mu_ } as the last element of _result_. 1. Else if _p_ is equal `"measureUnitName"` and _numberFormat_.[[UnitType]] is `"measureUnit"`, then 1. Let _measureUnit_ be _numberFormat_.[[MeasureUnit]]. - 1. Let _mu_ be an ILD string representing _measureUnit_ in long form, which may depend on _x_ in languages having different plural forms. If the implementation does not have such a representation of _measureUnit_, use _measureUnit_ itself. + 1. Let _mu_ be an ILD string representing _measureUnit_ in long form, which may depend on _x_ in languages having different plural forms. 1. Append a new Record { [[Type]]: `"unit"`, [[Value]]: _mu_ } as the last element of _result_. 1. Else if _p_ is equal `"currencyCode"` and _numberFormat_.[[UnitType]] is `"currency"`, then 1. Let _currency_ be _numberFormat_.[[Currency]]. diff --git a/numberformat_proposed_out.html b/numberformat_proposed_out.html index f4bfe33..bb4d4be 100644 --- a/numberformat_proposed_out.html +++ b/numberformat_proposed_out.html @@ -1877,7 +1877,7 @@

1.1.6PartitionNumberPattern ( numberFormat<

-
  1. Let exponent be 0.
  2. If x is NaN, then
    1. Let n be an ILD String value indicating the NaN value.
  3. Else if x is not a finite Number,
    1. Let n be an ILD String value indicating infinity.
  4. Else,
    1. If numberFormat.[[Style]] is "percent", let x be 100 × x.
    2. Let exponent be ComputeExponent(numberFormat, x).
    3. Let x be x × 10-exponent.
    4. Let formatNumberResult be FormatNumberToString(numberFormat, x).
    5. Let n be formatNumberResult.[[FormattedString]].
    6. Let x be formatNumberResult.[[RoundedNumber]].
  5. Let pattern be GetNumberFormatPattern(numberFormat, x, exponent)
  6. Let result be a new empty List.
  7. Let beginIndex be Call(%StringProto_indexOf%, pattern, « "{", 0 »).
  8. Let endIndex be 0.
  9. Let nextIndex be 0.
  10. Let length be the number of code units in pattern.
  11. Repeat, while beginIndex is an integer index into pattern
    1. Set endIndex to Call(%StringProto_indexOf%, pattern, « "}", beginIndex »).
    2. Assert: endIndex is greater than beginIndex.
    3. If beginIndex is greater than nextIndex, then
      1. Let literal be a substring of pattern from position nextIndex, inclusive, to position beginIndex, exclusive.
      2. Append a new Record { [[Type]]: "literal", [[Value]]: literal } as the last element of result.
    4. Let p be the substring of pattern from position beginIndex, exclusive, to position endIndex, exclusive.
    5. If p is equal "number", then
      1. If x is NaN, then
        1. Append a new Record { [[Type]]: "nan", [[Value]]: n } as the last element of result.
      2. Else if x is not a finite Number,
        1. Append a new Record { [[Type]]: "infinity", [[Value]]: n } as the last element of result.
      3. Else,
        1. If the numberFormat.[[NumberingSystem]] matches one of the values in the "Numbering System" column of Table 1 below, then
          1. Let digits be a List whose 10 String valued elements are the UTF-16 string representations of the 10 digits specified in the "Digits" column of the matching row in Table 1.
          2. Replace each digit in n with the value of digits[digit].
        2. Else use an implementation dependent algorithm to map n to the appropriate representation of n in the given numbering system.
        3. Let decimalSepIndex be Call(%StringProto_indexOf%, n, « ".", 0 »).
        4. If decimalSepIndex > 0, then
          1. Let integer be the substring of n from position 0, inclusive, to position decimalSepIndex, exclusive.
          2. Let fraction be the substring of n from position decimalSepIndex, exclusive, to the end of n.
        5. Else,
          1. Let integer be n.
          2. Let fraction be undefined.
        6. If the numberFormat.[[UseGrouping]] is true, then
          1. Let groupSepSymbol be the ILND String representing the grouping separator.
          2. Let groups be a List whose elements are, in left to right order, the substrings defined by ILND set of locations within the integer.
          3. Assert: The number of elements in groups List is greater than 0.
          4. Repeat, while groups List is not empty
            1. Remove the first element from groups and let integerGroup be the value of that element.
            2. Append a new Record { [[Type]]: "integer", [[Value]]: integerGroup } as the last element of result.
            3. If groups List is not empty, then
              1. Append a new Record { [[Type]]: "group", [[Value]]: groupSepSymbol } as the last element of result.
        7. Else,
          1. Append a new Record { [[Type]]: "integer", [[Value]]: integer } as the last element of result.
        8. If fraction is not undefined, then
          1. Let decimalSepSymbol be the ILND String representing the decimal separator.
          2. Append a new Record { [[Type]]: "decimal", [[Value]]: decimalSepSymbol } as the last element of result.
          3. Append a new Record { [[Type]]: "fraction", [[Value]]: fraction } as the last element of result.
    6. Else if p is equal "plusSign", then
      1. Let plusSignSymbol be the ILND String representing the plus sign.
      2. Append a new Record { [[Type]]: "plusSign", [[Value]]: plusSignSymbol } as the last element of result.
    7. Else if p is equal "minusSign", then
      1. Let minusSignSymbol be the ILND String representing the minus sign.
      2. Append a new Record { [[Type]]: "minusSign", [[Value]]: minusSignSymbol } as the last element of result.
    8. Else if p is equal "compactSymbol", then
      1. Let compactSymbol be an ILD string representing exponent in short form, which may depend on x in languages having different plural forms. The implementation must be able to provide this string, or else the pattern would not have a "{compactSymbol}" placeholder.
      2. Append a new Record { [[Type]]: "compact", [[Value]]: compactSymbol } as the last element of result.
    9. Else if p is equal "compactName", then
      1. Let compactName be an ILD string representing exponent in long form, which may depend on x in languages having different plural forms. The implementation must be able to provide this string, or else the pattern would not have a "{compactName}" placeholder.
      2. Append a new Record { [[Type]]: "compact", [[Value]]: compactName } as the last element of result.
    10. Else if p is equal "scientificSeparator", then
      1. Let scientificSeparator be the ILND String representing the exponent separator.
      2. Append a new Record { [[Type]]: "exponentSeparator", [[Value]]: scientificSeparator } as the last element of result.
    11. Else if p is equal "scientificExponent", then
      1. If exponent < 0, then
        1. Let minusSignSymbol be the ILND String representing the minus sign.
        2. Append a new Record { [[Type]]: "exponentMinusSign", [[Value]]: minusSignSymbol } as the last element of result.
        3. Let exponent be -exponent.
      2. Let exponentResult be ToRawFixed(exponent, 1, 0, 0).
      3. Append a new Record { [[Type]]: "exponentInteger", [[Value]]: exponentResult.[[FormattedString]] } as the last element of result.
    12. Else if p is equal "percentSign", then
      1. Let percentSignSymbol be the ILND String representing the percent sign.
      2. Append a new Record { [[Type]]: "percentSign", [[Value]]: percentSignSymbol } as the last element of result.
    13. Else if p is equal "measureUnitSymbol" and numberFormat.[[UnitType]] is "measureUnit", then
      1. Let measureUnit be numberFormat.[[MeasureUnit]].
      2. Let mu be an ILD string representing measureUnit in short form, which may depend on x in languages having different plural forms. If the implementation does not have such a representation of measureUnit, use measureUnit itself.
      3. Append a new Record { [[Type]]: "unit", [[Value]]: mu } as the last element of result.
    14. Else if p is equal "measureUnitNarrowSymbol" and numberFormat.[[UnitType]] is "measureUnit", then
      1. Let measureUnit be numberFormat.[[MeasureUnit]].
      2. Let mu be an ILD string representing measureUnit in narrow form, which may depend on x in languages having different plural forms. If the implementation does not have such a representation of measureUnit, use measureUnit itself.
      3. Append a new Record { [[Type]]: "unit", [[Value]]: mu } as the last element of result.
    15. Else if p is equal "measureUnitName" and numberFormat.[[UnitType]] is "measureUnit", then
      1. Let measureUnit be numberFormat.[[MeasureUnit]].
      2. Let mu be an ILD string representing measureUnit in long form, which may depend on x in languages having different plural forms. If the implementation does not have such a representation of measureUnit, use measureUnit itself.
      3. Append a new Record { [[Type]]: "unit", [[Value]]: mu } as the last element of result.
    16. Else if p is equal "currencyCode" and numberFormat.[[UnitType]] is "currency", then
      1. Let currency be numberFormat.[[Currency]].
      2. Let cd be currency.
      3. Append a new Record { [[Type]]: "currency", [[Value]]: cd } as the last element of result.
    17. Else if p is equal "currencySymbol" and numberFormat.[[UnitType]] is "currency", then
      1. Let currency be numberFormat.[[Currency]].
      2. Let cd be an ILD string representing currency in short form. If the implementation does not have such a representation of currency, use currency itself.
      3. Append a new Record { [[Type]]: "currency", [[Value]]: cd } as the last element of result.
    18. Else if p is equal "currencyNarrowSymbol" and numberFormat.[[UnitType]] is "currency", then
      1. Let currency be numberFormat.[[Currency]].
      2. Let cd be an ILD string representing currency in narrow form. If the implementation does not have such a representation of currency, use currency itself.
      3. Append a new Record { [[Type]]: "currency", [[Value]]: cd } as the last element of result.
    19. Else if p is equal "currencyName" and numberFormat.[[UnitType]] is "currency", then
      1. Let currency be numberFormat.[[Currency]].
      2. Let cd be an ILD string representing currency in long form, which may depend on x in languages having different plural forms. If the implementation does not have such a representation of currency, use currency itself.
      3. Append a new Record { [[Type]]: "currency", [[Value]]: cd } as the last element of result.
    20. Else,
      1. Let literal be the substring of pattern from position beginIndex, inclusive, to position endIndex, inclusive.
      2. Append a new Record { [[Type]]: "literal", [[Value]]: literal } as the last element of result.
    21. Set nextIndex to endIndex + 1.
    22. Set beginIndex to Call(%StringProto_indexOf%, pattern, « "{", nextIndex »).
  12. If nextIndex is less than length, then
    1. Let literal be the substring of pattern from position nextIndex, inclusive, to position length, exclusive.
    2. Append a new Record { [[Type]]: "literal", [[Value]]: literal } as the last element of result.
  13. Return result. +
    1. Let exponent be 0.
    2. If x is NaN, then
      1. Let n be an ILD String value indicating the NaN value.
    3. Else if x is not a finite Number,
      1. Let n be an ILD String value indicating infinity.
    4. Else,
      1. If numberFormat.[[Style]] is "percent", let x be 100 × x.
      2. Let exponent be ComputeExponent(numberFormat, x).
      3. Let x be x × 10-exponent.
      4. Let formatNumberResult be FormatNumberToString(numberFormat, x).
      5. Let n be formatNumberResult.[[FormattedString]].
      6. Let x be formatNumberResult.[[RoundedNumber]].
    5. Let pattern be GetNumberFormatPattern(numberFormat, x, exponent)
    6. Let result be a new empty List.
    7. Let beginIndex be Call(%StringProto_indexOf%, pattern, « "{", 0 »).
    8. Let endIndex be 0.
    9. Let nextIndex be 0.
    10. Let length be the number of code units in pattern.
    11. Repeat, while beginIndex is an integer index into pattern
      1. Set endIndex to Call(%StringProto_indexOf%, pattern, « "}", beginIndex »).
      2. Assert: endIndex is greater than beginIndex.
      3. If beginIndex is greater than nextIndex, then
        1. Let literal be a substring of pattern from position nextIndex, inclusive, to position beginIndex, exclusive.
        2. Append a new Record { [[Type]]: "literal", [[Value]]: literal } as the last element of result.
      4. Let p be the substring of pattern from position beginIndex, exclusive, to position endIndex, exclusive.
      5. If p is equal "number", then
        1. If x is NaN, then
          1. Append a new Record { [[Type]]: "nan", [[Value]]: n } as the last element of result.
        2. Else if x is not a finite Number,
          1. Append a new Record { [[Type]]: "infinity", [[Value]]: n } as the last element of result.
        3. Else,
          1. If the numberFormat.[[NumberingSystem]] matches one of the values in the "Numbering System" column of Table 1 below, then
            1. Let digits be a List whose 10 String valued elements are the UTF-16 string representations of the 10 digits specified in the "Digits" column of the matching row in Table 1.
            2. Replace each digit in n with the value of digits[digit].
          2. Else use an implementation dependent algorithm to map n to the appropriate representation of n in the given numbering system.
          3. Let decimalSepIndex be Call(%StringProto_indexOf%, n, « ".", 0 »).
          4. If decimalSepIndex > 0, then
            1. Let integer be the substring of n from position 0, inclusive, to position decimalSepIndex, exclusive.
            2. Let fraction be the substring of n from position decimalSepIndex, exclusive, to the end of n.
          5. Else,
            1. Let integer be n.
            2. Let fraction be undefined.
          6. If the numberFormat.[[UseGrouping]] is true, then
            1. Let groupSepSymbol be the ILND String representing the grouping separator.
            2. Let groups be a List whose elements are, in left to right order, the substrings defined by ILND set of locations within the integer.
            3. Assert: The number of elements in groups List is greater than 0.
            4. Repeat, while groups List is not empty
              1. Remove the first element from groups and let integerGroup be the value of that element.
              2. Append a new Record { [[Type]]: "integer", [[Value]]: integerGroup } as the last element of result.
              3. If groups List is not empty, then
                1. Append a new Record { [[Type]]: "group", [[Value]]: groupSepSymbol } as the last element of result.
          7. Else,
            1. Append a new Record { [[Type]]: "integer", [[Value]]: integer } as the last element of result.
          8. If fraction is not undefined, then
            1. Let decimalSepSymbol be the ILND String representing the decimal separator.
            2. Append a new Record { [[Type]]: "decimal", [[Value]]: decimalSepSymbol } as the last element of result.
            3. Append a new Record { [[Type]]: "fraction", [[Value]]: fraction } as the last element of result.
      6. Else if p is equal "plusSign", then
        1. Let plusSignSymbol be the ILND String representing the plus sign.
        2. Append a new Record { [[Type]]: "plusSign", [[Value]]: plusSignSymbol } as the last element of result.
      7. Else if p is equal "minusSign", then
        1. Let minusSignSymbol be the ILND String representing the minus sign.
        2. Append a new Record { [[Type]]: "minusSign", [[Value]]: minusSignSymbol } as the last element of result.
      8. Else if p is equal "compactSymbol", then
        1. Let compactSymbol be an ILD string representing exponent in short form, which may depend on x in languages having different plural forms. The implementation must be able to provide this string, or else the pattern would not have a "{compactSymbol}" placeholder.
        2. Append a new Record { [[Type]]: "compact", [[Value]]: compactSymbol } as the last element of result.
      9. Else if p is equal "compactName", then
        1. Let compactName be an ILD string representing exponent in long form, which may depend on x in languages having different plural forms. The implementation must be able to provide this string, or else the pattern would not have a "{compactName}" placeholder.
        2. Append a new Record { [[Type]]: "compact", [[Value]]: compactName } as the last element of result.
      10. Else if p is equal "scientificSeparator", then
        1. Let scientificSeparator be the ILND String representing the exponent separator.
        2. Append a new Record { [[Type]]: "exponentSeparator", [[Value]]: scientificSeparator } as the last element of result.
      11. Else if p is equal "scientificExponent", then
        1. If exponent < 0, then
          1. Let minusSignSymbol be the ILND String representing the minus sign.
          2. Append a new Record { [[Type]]: "exponentMinusSign", [[Value]]: minusSignSymbol } as the last element of result.
          3. Let exponent be -exponent.
        2. Let exponentResult be ToRawFixed(exponent, 1, 0, 0).
        3. Append a new Record { [[Type]]: "exponentInteger", [[Value]]: exponentResult.[[FormattedString]] } as the last element of result.
      12. Else if p is equal "percentSign", then
        1. Let percentSignSymbol be the ILND String representing the percent sign.
        2. Append a new Record { [[Type]]: "percentSign", [[Value]]: percentSignSymbol } as the last element of result.
      13. Else if p is equal "measureUnitSymbol" and numberFormat.[[UnitType]] is "measureUnit", then
        1. Let measureUnit be numberFormat.[[MeasureUnit]].
        2. Let mu be an ILD string representing measureUnit in short form, which may depend on x in languages having different plural forms.
        3. Append a new Record { [[Type]]: "unit", [[Value]]: mu } as the last element of result.
      14. Else if p is equal "measureUnitNarrowSymbol" and numberFormat.[[UnitType]] is "measureUnit", then
        1. Let measureUnit be numberFormat.[[MeasureUnit]].
        2. Let mu be an ILD string representing measureUnit in narrow form, which may depend on x in languages having different plural forms.
        3. Append a new Record { [[Type]]: "unit", [[Value]]: mu } as the last element of result.
      15. Else if p is equal "measureUnitName" and numberFormat.[[UnitType]] is "measureUnit", then
        1. Let measureUnit be numberFormat.[[MeasureUnit]].
        2. Let mu be an ILD string representing measureUnit in long form, which may depend on x in languages having different plural forms.
        3. Append a new Record { [[Type]]: "unit", [[Value]]: mu } as the last element of result.
      16. Else if p is equal "currencyCode" and numberFormat.[[UnitType]] is "currency", then
        1. Let currency be numberFormat.[[Currency]].
        2. Let cd be currency.
        3. Append a new Record { [[Type]]: "currency", [[Value]]: cd } as the last element of result.
      17. Else if p is equal "currencySymbol" and numberFormat.[[UnitType]] is "currency", then
        1. Let currency be numberFormat.[[Currency]].
        2. Let cd be an ILD string representing currency in short form. If the implementation does not have such a representation of currency, use currency itself.
        3. Append a new Record { [[Type]]: "currency", [[Value]]: cd } as the last element of result.
      18. Else if p is equal "currencyNarrowSymbol" and numberFormat.[[UnitType]] is "currency", then
        1. Let currency be numberFormat.[[Currency]].
        2. Let cd be an ILD string representing currency in narrow form. If the implementation does not have such a representation of currency, use currency itself.
        3. Append a new Record { [[Type]]: "currency", [[Value]]: cd } as the last element of result.
      19. Else if p is equal "currencyName" and numberFormat.[[UnitType]] is "currency", then
        1. Let currency be numberFormat.[[Currency]].
        2. Let cd be an ILD string representing currency in long form, which may depend on x in languages having different plural forms. If the implementation does not have such a representation of currency, use currency itself.
        3. Append a new Record { [[Type]]: "currency", [[Value]]: cd } as the last element of result.
      20. Else,
        1. Let literal be the substring of pattern from position beginIndex, inclusive, to position endIndex, inclusive.
        2. Append a new Record { [[Type]]: "literal", [[Value]]: literal } as the last element of result.
      21. Set nextIndex to endIndex + 1.
      22. Set beginIndex to Call(%StringProto_indexOf%, pattern, « "{", nextIndex »).
    12. If nextIndex is less than length, then
      1. Let literal be the substring of pattern from position nextIndex, inclusive, to position length, exclusive.
      2. Append a new Record { [[Type]]: "literal", [[Value]]: literal } as the last element of result.
    13. Return result.
    Table 1: Numbering systems with simple digit mappings