Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEEDBACK] Please move style percent to its own function #956

Open
sffc opened this issue Nov 21, 2024 · 3 comments
Open

[FEEDBACK] Please move style percent to its own function #956

sffc opened this issue Nov 21, 2024 · 3 comments
Labels
LDML 47 LDML 47 Release (Stable) Preview-Feedback Feedback gathered during the technical preview registry

Comments

@sffc
Copy link
Member

sffc commented Nov 21, 2024

Recently, currency and unit formatting were moved to their own registry functions. However, there is still style that is either "decimal" or "percent".

This does not make sense. Please either remove "percent" (since a unit formatter should be able to handle it) or move it to its own function.

@sffc sffc added the Preview-Feedback Feedback gathered during the technical preview label Nov 21, 2024
@aphillips aphillips added registry LDML 47 LDML 47 Release (Stable) labels Nov 21, 2024
@sffc
Copy link
Member Author

sffc commented Nov 21, 2024

@macchiati was making an argument that formatting a percent is actually a formatting hint. "0.5 = 0.5 = 50% != 0.5%".

Even in this case, the name "style" is something we generally try to avoid because it is such a vague term. We should consider renaming the option to be dimensionlessDisplay or similar.

@aphillips
Copy link
Member

(chair hat ON)

Thank you for the feedback!

The WG consensus in the 2024-10-28 teleconference was to keep percentage formatting in :number/:integer.

The name style is taken directly from Intl.NumberFormat (as noted in the document).

A proposal to change this should start from a design document.

(chair hat OFF)

I personally think that, with the addition of :math, :currency, and :unit, the percent formatting looks less reasonable inside of the core number formatters.

@sffc
Copy link
Member Author

sffc commented Nov 21, 2024

The name style is taken directly from Intl.NumberFormat (as noted in the document).

I don't buy this argument because style is a toggle between unit, currency, percent, and decimal in ECMA-402. Pulling unit and current out means that style is no longer parallel with ECMA-402. This is motivation for it to not be named the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LDML 47 LDML 47 Release (Stable) Preview-Feedback Feedback gathered during the technical preview registry
Projects
None yet
Development

No branches or pull requests

2 participants