Intl.NumberFormat
: maximumFractionDigits
is used for exact number of digits instead of maximum for style: "currency"
#57137
Labels
i18n-api
Issues and PRs related to the i18n implementation.
Version
v22.14.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Run the following:
How often does it reproduce? Is there a required condition?
Constantly
What is the expected behavior? Why is that the expected behavior?
The previous code snippet should output
"$3M"
, because the number is round, notation is set to"compact"
andmaximumFractionDigits
is set to1
. For comparison Chrome 133.0.6943.98 (V8 13.3.415.21) correctly outputs"$3M"
.What do you see instead?
The previous code outputs
"$3.0M"
in Node.js v22.14.0 (V8 12.4.254.21-node.22), while Chrome 133.0.6943.98 (V8 13.3.415.21) outputs"$3M"
.It seems that when using
style: "currency"
and specifyingmaximumFractionDigits
, for some reason Node.js uses that number as the exact number of fraction digits instead of a maximum.Additional information
No response
The text was updated successfully, but these errors were encountered: