FormattedNumber output when using percentages has an inappropriate default scale
samkelleher opened this issue · comments
Which package?
intl-messageformat-parser
Describe the bug
An input number of 25
is formatted as 2,500%
instead of 25%
because, for some reason, the scale is defaulting to 100
. In the examples as per the spec, the default scale is 1
. The multiplier would only be added if explicitly defined. Additionally, adding a scale/1
directive doesn't do anything.
See Also
Why
{value, number, ::percent}
appliesscale/100
by default?Originally posted by @ZerdoX-x in #1072 (comment)
Relates to:
can u provide a codesandbox?
in my PR #4315 which introduces a live icu editor, you can see the default scale is 100
hmm the default scale
is basically the ECMA-402 behavior, which conflicts with ICU. This unfortunately is a breaking change so I'm kinda reluctant to fix it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.