1- ## Numeric Value Selection and Formatting
1+ ### Numeric Value Selection and Formatting
22
3- ### The ` :number ` function
3+ #### The ` :number ` function
44
55The function ` :number ` is a selector and formatter for numeric values.
66
7- #### Operands
7+ ##### Operands
88
99The function ` :number ` requires a [ Number Operand] ( #number-operands ) as its _ operand_ .
1010
11- #### Options
11+ ##### Options
1212
1313Some options do not have default values defined in this specification.
1414The defaults for these options are implementation-dependent.
@@ -83,27 +83,27 @@ with _options_ on the _expression_ taking priority over any option values of the
8383> would be formatted with the resolved options
8484> `{ minimumFractionDigits: '1', signDisplay: 'always' }`.
8585
86- #### Resolved Value
86+ ##### Resolved Value
8787
8888The _resolved value_ of an _expression_ with a `:number` _function_
8989contains an implementation-defined numerical value
9090of the _operand_ of the annotated _expression_,
9191together with the resolved options' values.
9292
93- #### Selection
93+ ##### Selection
9494
9595The _function_ `:number` performs selection as described in [Number Selection](#number-selection) below.
9696
97- ### The `:integer` function
97+ #### The `:integer` function
9898
9999The function `:integer` is a selector and formatter for matching or formatting numeric
100100values as integers.
101101
102- #### Operands
102+ ##### Operands
103103
104104The function `:integer` requires a [Number Operand](#number-operands) as its _operand_.
105105
106- #### Options
106+ ##### Options
107107
108108Some options do not have default values defined in this specification.
109109The defaults for these options are implementation-dependent.
@@ -148,18 +148,18 @@ Option values with the following names are however discarded if included in the
148148- `maximumFractionDigits`
149149- `minimumSignificantDigits`
150150
151- #### Resolved Value
151+ ##### Resolved Value
152152
153153The _resolved value_ of an _expression_ with an `:integer` _function_
154154contains the implementation-defined integer value
155155of the _operand_ of the annotated _expression_,
156156together with the resolved options' values.
157157
158- #### Selection
158+ ##### Selection
159159
160160The _function_ `:integer` performs selection as described in [Number Selection](#number-selection) below.
161161
162- ### The `:math` function
162+ #### The `:math` function
163163
164164> [!IMPORTANT]
165165> The _function_ `:math` has a status of **Draft**.
@@ -182,11 +182,11 @@ numeric values to which a mathematical operation has been applied.
182182> * * {{{$name} and {$others_count} other users liked your post.}}
183183> ```
184184
185- #### Operands
185+ ##### Operands
186186
187187The function `:math` requires a [Number Operand](#number-operands) as its _operand_.
188188
189- #### Options
189+ ##### Options
190190
191191The options on `:math` are exclusive with each other,
192192and exactly one option is always required.
@@ -204,7 +204,7 @@ or if an _option_ value is not a [digit size option](#digit-size-options),
204204a _Bad Option_ error is emitted
205205and a _fallback value_ used as the _resolved value_ of the _expression_.
206206
207- #### Resolved Value
207+ ##### Resolved Value
208208
209209The _resolved value_ of an _expression_ with a `:math` _function_
210210contains the implementation-defined numeric value
@@ -231,11 +231,11 @@ The `:math` _options_ are not included in the resolved option values.
231231> In such cases, implementations can emit an _Unsupported Operation_ error
232232> or they might just silently overflow the underlying data value.
233233
234- #### Selection
234+ ##### Selection
235235
236236The _function_ `:math` performs selection as described in [Number Selection](#number-selection) below.
237237
238- ### The `:currency` function
238+ #### The `:currency` function
239239
240240> [!IMPORTANT]
241241> The _function_ `:currency` has a status of **Draft**.
@@ -244,7 +244,7 @@ The _function_ `:math` performs selection as described in [Number Selection](#nu
244244The _function_ `:currency` is a _formatter_ for currency values,
245245which are a specialized form of numeric formatting.
246246
247- #### Operands
247+ ##### Operands
248248
249249The _operand_ of the `:currency` function can be one of any number of
250250implementation-defined types,
@@ -294,7 +294,7 @@ A [Number Operand](#number-operands) without a `currency` _option_ results in a
294294> }
295295> ```
296296
297- #### Options
297+ ##### Options
298298
299299Some options do not have default values defined in this specification.
300300The defaults for these options are implementation-dependent.
@@ -406,14 +406,14 @@ with _options_ on the _expression_ taking priority over any option values of the
406406> would be formatted with the resolved options
407407> `{ currencySign: 'accounting', trailingZeroDisplay: 'stripIfInteger', currency: 'USD' }`.
408408
409- #### Resolved Value
409+ ##### Resolved Value
410410
411411The _resolved value_ of an _expression_ with a `:currency` _function_
412412contains an implementation-defined currency value
413413of the _operand_ of the annotated _expression_,
414414together with the resolved options' values.
415415
416- ### The `:unit` function
416+ #### The `:unit` function
417417
418418> [!IMPORTANT]
419419> The _function_ `:unit` has a status of **Draft**.
@@ -423,7 +423,7 @@ The _function_ `:unit` is proposed to be a RECOMMENDED formatter for unitized va
423423that is, for numeric values associated with a unit of measurement.
424424This is a specialized form of numeric formatting.
425425
426- #### Operands
426+ ##### Operands
427427
428428The _operand_ of the `:unit` function can be one of any number of
429429implementation-defined types,
@@ -457,7 +457,7 @@ A [Number Operand](#number-operands) without a `unit` _option_ results in a _Bad
457457> }
458458> ```
459459
460- #### Options
460+ ##### Options
461461
462462Some _options_ do not have default values defined in this specification.
463463The defaults for these _options_ are implementation-dependent.
@@ -532,14 +532,14 @@ with _options_ on the _expression_ taking priority over any _option_ values of t
532532> would have the resolved options:
533533> `{ unit: 'furlong', minimumFractionDigits: '2', minimumIntegerDigits: '1' }`.
534534
535- #### Resolved Value
535+ ##### Resolved Value
536536
537537The _resolved value_ of an _expression_ with a `:unit` _function_
538538consist of an implementation-defined unit value
539539of the _operand_ of the annotated _expression_,
540540together with the resolved _options_ and their resolved values.
541541
542- #### Unit Conversion
542+ ##### Unit Conversion
543543
544544Implementations MAY support conversion to the locale's preferred units via the `usage` _option_.
545545Implementing this _option_ is optional.
@@ -570,7 +570,7 @@ Implementations MUST NOT substitute the unit without performing the associated c
570570>
571571> This can produce "You have 405 feet to go."
572572
573- ### Number Operands
573+ #### Number Operands
574574
575575The _operand_ of a number function is either an implementation-defined type or
576576a literal whose contents match the following `number-literal` production.
@@ -608,7 +608,7 @@ number-literal = ["-"] (%x30 / (%x31-39 *DIGIT)) ["." 1*DIGIT] [%i"e" ["-" / "+"
608608> or the type `com.ibm.icu.util.CurrencyAmount` can be used to set the currency and related
609609> options (such as the number of fraction digits).
610610
611- ### Digit Size Options
611+ #### Digit Size Options
612612
613613Some _options_ of number _functions_ are defined to take a "digit size option".
614614The _function handlers_ for number _functions_ use these _options_ to control aspects of numeric display
@@ -632,7 +632,7 @@ If the value of a digit size option does not evaluate as a non-negative integer,
632632or if the value exceeds any implementation-defined upper limit
633633or any option-specific lower limit, a _ Bad Option Error_ is emitted.
634634
635- ### Number Selection
635+ #### Number Selection
636636
637637The value of the ` select ` _ option_ MUST be set by a _ literal_ ,
638638as otherwise the _ message_ might not be translatable.
@@ -674,7 +674,7 @@ numeric selectors perform as described below.
674674> Implementations are not required to implement this exactly as written.
675675> However, the observed behavior must be consistent with what is described here.
676676
677- #### Default Value of ` select ` Option
677+ ##### Default Value of ` select ` Option
678678
679679The value ` plural ` is the default for the option ` select `
680680because it is the most common use case for numeric selection.
@@ -697,7 +697,7 @@ but can cause problems in target locales that the original developer is not cons
697697> The `one` variant is needed by languages such as Polish or Russian.
698698> Such locales typically also require other keywords such as `two`, `few`, and `many`.
699699
700- #### Rule Selection
700+ ##### Rule Selection
701701
702702Rule selection is intended to support the grammatical matching needs of different
703703languages/locales in order to support plural or ordinal numeric values.
@@ -757,7 +757,7 @@ for examples.
757757> | 27 | `other` | 27 dní |
758758> | 2.4 | `many` | 2,4 dne |
759759
760- #### Exact Literal Match Serialization
760+ ##### Exact Literal Match Serialization
761761
762762If the numeric value of `resolvedSelector` is an integer
763763and none of the following options are set for `resolvedSelector`,
0 commit comments