message-format-wg icon indicating copy to clipboard operation
message-format-wg copied to clipboard

[FEEDBACK] Please move style percent to its own function

Open sffc opened this issue 1 year ago • 8 comments

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 avatar Nov 21 '24 23:11 sffc

@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.

sffc avatar Nov 21 '24 23:11 sffc

(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.

aphillips avatar Nov 21 '24 23:11 aphillips

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 avatar Nov 21 '24 23:11 sffc

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.

sffc avatar Dec 28 '24 06:12 sffc

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 avatar Feb 10 '25 22:02 eemeli

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

aphillips avatar Feb 14 '25 15:02 aphillips

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

aphillips avatar Apr 07 '25 17:04 aphillips

#1068 will resolve this item.

aphillips avatar May 20 '25 23:05 aphillips