Skip to content

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

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

Open
sffc opened this issue Nov 21, 2024 · 8 comments · Fixed by #988
Open

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

sffc opened this issue Nov 21, 2024 · 8 comments · Fixed by #988
Assignees
Labels
design Design document or issues related to design functions Issue pertains to the default function set LDML48 LDML48 Release Preview-Feedback Feedback gathered during the technical preview resolve-candidate This issue appears to have been answered or resolved, and may be closed soon.

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 functions Issue pertains to the default function set LDML47 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.

@sffc
Copy link
Member Author

sffc commented Dec 28, 2024

This is not fixed, and registry.md says "The following options and their values are required to be available". So please fix this before LDML 47.

@eemeli
Copy link
Collaborator

eemeli commented Feb 10, 2025

PR #988 ended up only removing style=percent. We do have :unit unit=percent, but that doesn't scale the input, so I'm reopening this to mark that we still need a solution for scaled percent formatting.

@eemeli eemeli reopened this Feb 10, 2025
@aphillips aphillips added LDML48 LDML48 Release and removed LDML47 LDML 47 Release (Stable) labels Feb 14, 2025
@aphillips
Copy link
Member

Moving to v48. We already agreed that this will not make 47

@aphillips aphillips added design Design document or issues related to design Action-Item Action item assigned by the WG labels Apr 7, 2025
@aphillips aphillips self-assigned this Apr 7, 2025
@aphillips
Copy link
Member

In the 2025-04-07 call we decided that the next step is a design doc. I assigned that action to myself.

@aphillips aphillips removed the Action-Item Action item assigned by the WG label Apr 14, 2025
@aphillips aphillips added the resolve-candidate This issue appears to have been answered or resolved, and may be closed soon. label May 20, 2025
@aphillips
Copy link
Member

#1068 will resolve this item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design document or issues related to design functions Issue pertains to the default function set LDML48 LDML48 Release Preview-Feedback Feedback gathered during the technical preview resolve-candidate This issue appears to have been answered or resolved, and may be closed soon.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants