You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on spec changes for the Unified NumberFormat proposal. I noticed a couple things about currency long names that didn't look quite right:
Let stylePatterns be patterns.[[<style>]].
Set numberFormat.[[PositivePattern]] to stylePatterns.[[positivePattern]].
Set numberFormat.[[NegativePattern]] to stylePatterns.[[negativePattern]].
Let pattern be numberFormat.[[PositivePattern]].
... extract fields out of pattern ...
Else if p is equal "currency" and numberFormat.[[Style]] is "currency", then
..Let currency be numberFormat.[[Currency]].
..Assert: numberFormat.[[CurrencyDisplay]] is "code", "symbol" or "name".
..If numberFormat.[[CurrencyDisplay]] is "code", then
....Let cd be currency.
..Else if numberFormat.[[CurrencyDisplay]] is "symbol", then
....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.
..Else if numberFormat.[[CurrencyDisplay]] is "name", then
....Let cd be an ILD string representing currency in long form. If the implementation does not have such a representation of currency, use currency itself.
..Append a new Record { [[Type]]: "currency", [[Value]]: cd } as the last element of result.
The spec makes no distinction between the pattern used for any of the three CurrencyDisplay values; it simply gets the pattern for the style "currency". Then, when substituting into the pattern, it puts whichever currency form in that same spot.
This means that when I change CurrencyDisplay, the only thing that should change, according to the spec, is the form of the currency. The position and everything else should be the same. This is not, of course, what happens:
There are at least three things the spec does not account for:
The position of the currency changes depending on the style.
The form of the currency long name changes based on the plural form.
There may be a space inserted conditionally between the number and the currency. (This is in the CLDR spec and ICU will start doing it for currency codes in ICU 62; it already does it for long names.)
I plan to fix up the spec along with my other changes. Is that okay?
The text was updated successfully, but these errors were encountered:
I have the fix drafted in my Unified Number Format proposal. Basically what I did was to make the pattern string in general dependent on more variables, the currency width being one of them; this solves problems 1 and 3. I also changed some language to say that the currency long name may depend on the number being formatted; this solves problem 2.
I've been working on spec changes for the Unified NumberFormat proposal. I noticed a couple things about currency long names that didn't look quite right:
Section 11.1.2:
Section 11.1.6:
The spec makes no distinction between the pattern used for any of the three CurrencyDisplay values; it simply gets the pattern for the style "currency". Then, when substituting into the pattern, it puts whichever currency form in that same spot.
This means that when I change CurrencyDisplay, the only thing that should change, according to the spec, is the form of the currency. The position and everything else should be the same. This is not, of course, what happens:
There are at least three things the spec does not account for:
I plan to fix up the spec along with my other changes. Is that okay?
The text was updated successfully, but these errors were encountered: