From c930a5e9a60b2f557cb3d3450b416e6c6c6663ba Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Tue, 17 Sep 2024 11:47:21 -0700 Subject: [PATCH] Normative: When formatting currency values, only use data on the number of minor units used to display that currency when using standard notation. Previously this data was inappropriately used to set the number of fractional digits displayed when formatting currency values in scientific, engineering, and compact notations. See issue #912. --- spec/numberformat.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/numberformat.html b/spec/numberformat.html index 1ac43463..dc05e3e5 100644 --- a/spec/numberformat.html +++ b/spec/numberformat.html @@ -35,6 +35,9 @@

Intl.NumberFormat ( [ _locales_ [ , _options_ ] ] )

1. Let _style_ be _numberFormat_.[[Style]]. 1. If _style_ is *"currency"*, then 1. Let _currency_ be _numberFormat_.[[Currency]]. + 1. Let _notation_ be ? GetOption(_options_, *"notation"*, ~string~, « *"standard"*, *"scientific"*, *"engineering"*, *"compact"* », *"standard"*). + 1. Set _numberFormat_.[[Notation]] to _notation_. + 1. If _style_ is *"currency"* and *"notation"* is *"standard"*, then 1. Let _cDigits_ be CurrencyDigits(_currency_). 1. Let _mnfdDefault_ be _cDigits_. 1. Let _mxfdDefault_ be _cDigits_. @@ -44,8 +47,6 @@

Intl.NumberFormat ( [ _locales_ [ , _options_ ] ] )

1. Let _mxfdDefault_ be 0. 1. Else, 1. Let _mxfdDefault_ be 3. - 1. Let _notation_ be ? GetOption(_options_, *"notation"*, ~string~, « *"standard"*, *"scientific"*, *"engineering"*, *"compact"* », *"standard"*). - 1. Set _numberFormat_.[[Notation]] to _notation_. 1. Perform ? SetNumberFormatDigitOptions(_numberFormat_, _options_, _mnfdDefault_, _mxfdDefault_, _notation_). 1. Let _compactDisplay_ be ? GetOption(_options_, *"compactDisplay"*, ~string~, « *"short"*, *"long"* », *"short"*). 1. Let _defaultUseGrouping_ be *"auto"*.