Skip to content

Commit 2fe2111

Browse files
aphillipseemelistasm
authored
Define non-negative integer option (#741)
* Define non-negative integer option @catamorphism identified this as a gap in e.g. #739. This PR defines what a non-negative integer option value is for `:number` and `:integer`. It does not attempt to address the larger question raised in 738/739. * Address @eemelie's comment ... via a rewrite. Adds an example. Permits upper length limit. Removes any mention of types. Permits an upper numeric amount (e.g. if you're implementation of number formatting is limited to, say, 64 digits, you can make the maximum allowed value `64`) * Update spec/registry.md * Address comments * Update spec/registry.md * Update spec/registry.md Co-authored-by: Eemeli Aro <[email protected]> * Update spec/registry.md Co-authored-by: Stanisław Małolepszy <[email protected]> * Implement changes discussed in 2024-03-25 call * Address comments --------- Co-authored-by: Eemeli Aro <[email protected]> Co-authored-by: Stanisław Małolepszy <[email protected]>
1 parent 09a8116 commit 2fe2111

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

spec/registry.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -398,15 +398,15 @@ The following options and their values are required to be available on the funct
398398
- `never`
399399
- `min2`
400400
- `minimumIntegerDigits`
401-
- (non-negative integer, default: `1`)
401+
- ([digit size option](#digit-size-options), default: `1`)
402402
- `minimumFractionDigits`
403-
- (non-negative integer)
403+
- ([digit size option](#digit-size-options))
404404
- `maximumFractionDigits`
405-
- (non-negative integer)
405+
- ([digit size option](#digit-size-options))
406406
- `minimumSignificantDigits`
407-
- (non-negative integer)
407+
- ([digit size option](#digit-size-options))
408408
- `maximumSignificantDigits`
409-
- (non-negative integer)
409+
- ([digit size option](#digit-size-options))
410410
411411
> [!NOTE]
412412
> The following options and option values are being developed during the Technical Preview
@@ -515,9 +515,9 @@ function `:integer`:
515515
- `always`
516516
- `min2`
517517
- `minimumIntegerDigits`
518-
- (non-negative integer, default: `1`)
518+
- ([digit size option](#digit-size-options), default: `1`)
519519
- `maximumSignificantDigits`
520-
- (non-negative integer)
520+
- ([digit size option](#digit-size-options))
521521
522522
> [!NOTE]
523523
> The following options and option values are being developed during the Technical Preview
@@ -619,6 +619,24 @@ All other values produce an _Invalid Expression_ error.
619619
> or the type `com.ibm.icu.util.CurrencyAmount` can be used to set the currency and related
620620
> options (such as the number of fraction digits).
621621
622+
### Digit Size Options
623+
624+
Some _options_ of number _functions_ are defined to take a "digit size option".
625+
Implementations of number _functions_ use these _options_ to control aspects of numeric display
626+
such as the number of fraction, integer, or significant digits.
627+
628+
A "digit size option" is an _option_ value that the _function_ interprets
629+
as a small integer value greater than or equal to zero.
630+
Implementations MAY define an upper limit on the resolved value
631+
of a digit size option option consistent with that implementation's practical limits.
632+
633+
In most cases, the value of a digit size option will be a string that
634+
encodes the value as a decimal integer.
635+
Implementations MAY also accept implementation-defined types as the value.
636+
When provided as a string, the representation of a digit size option matches the following ABNF:
637+
>```abnf
638+
> digit-size-option = "0" / (("1"-"9") [DIGIT])
639+
>```
622640
623641
624642
### Number Selection

0 commit comments

Comments
 (0)