Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 4 additions & 26 deletions spec/functions/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ The _function_ `:math` performs selection as described in [Number Selection](#nu

### The `:currency` function

The function `:currency` is a selector and formatter for currency values,
which are a specialized form of numeric selection and formatting.
The function `:currency` is a formatter for currency values,
which are a specialized form of numeric formatting.

#### Operands

Expand Down Expand Up @@ -388,15 +388,8 @@ Some implementations might not be able to produce all of these formats for every
> [options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options)
> in JavaScript's `Intl.NumberFormat`.

> [!NOTE]
> The option `select` does not accept the value `ordinal` because selecting
> currency values using ordinal rules makes no sense.

The following options and their values are required to be available on the function `:currency`:

- `select`
- `plural` (default; see [Default Value of `select` Option](#default-value-of-select-option) below)
- `exact`
- `currency`
- well-formed [Unicode Currency Identifier](https://cldr-smoke.unicode.org/spec/main/ldml/tr35.html#UnicodeCurrencyIdentifier)
(no default)
Expand Down Expand Up @@ -475,16 +468,12 @@ contains an implementation-defined currency value
of the _operand_ of the annotated _expression_,
together with the resolved options' values.

#### Selection

The _function_ `:currency` performs selection as described in [Number Selection](#number-selection) below.

### The `:unit` function

The _function_ `:unit` is **Proposed** for inclusion in the next release of this specification but has not yet been finalized.
The _function_ `:unit` is proposed to be a **RECOMMENDED** selector and formatter for unitized values,
The _function_ `:unit` is proposed to be a **RECOMMENDED** formatter for unitized values,
that is, for numeric values associated with a unit of measurement.
This is a specialized form of numeric selection and formatting.
This is a specialized form of numeric formatting.

#### Operands

Expand Down Expand Up @@ -528,15 +517,8 @@ In general, the default values for such _options_ depend on the locale,
the unit,
the value of other _options_, or all of these.

> [!NOTE]
> The option `select` does not accept the value `ordinal` because selecting
> unit values using ordinal rules makes no sense.

The following options and their values are required to be available on the function `:unit`:

- `select`
- `plural` (default; see [Default Value of `select` Option](#default-value-of-select-option) below)
- `exact`
- `unit`
- valid [Unit Identifier](https://www.unicode.org/reports/tr35/tr35-general.html#unit-identifiers)
(no default)
Expand Down Expand Up @@ -617,10 +599,6 @@ consist of an implementation-defined unit value
of the _operand_ of the annotated _expression_,
together with the resolved _options_ and their resolved values.

#### Selection

The _function_ `:unit` performs selection as described in [Number Selection](#number-selection) below.

#### Unit Conversion

Implementations MAY support conversion to the locale's preferred units via the `usage` _option_.
Expand Down
2 changes: 1 addition & 1 deletion test/tests/functions/currency.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
{
"src": ".local $n = {42 :currency currency=EUR} .match $n * {{other}}",
"exp": "other",
"expErrors": false
"expErrors": [{ "type": "bad-selector" }]
}
]
}
Loading