Skip to content

Intl.NumberFormat: maximumFractionDigits is used for exact number of digits instead of maximum for style: "currency" #57137

Description

@amitbeck

Version

v22.14.0

Platform

Darwin MacBook-Pro 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020 arm64

Subsystem

No response

What steps will reproduce the bug?

Run the following:

Intl.NumberFormat('en-US', {
  notation: 'compact',
  maximumFractionDigits: 1,
  style: 'currency',
  currency: 'USD'
}).format(3_000_000)

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" and maximumFractionDigits is set to 1. 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 specifying maximumFractionDigits, for some reason Node.js uses that number as the exact number of fraction digits instead of a maximum.

Additional information

No response

Activity

  1. targos commented on Feb 20, 2025

    @targos
    Member

    This will be fixed in the next V8 update (#57114), but only in v24.

  2. added
    i18n-apiIssues and PRs related to Node.js internationalization support.
    on Feb 20, 2025
  3. github-actions commented on Apr 20, 2026

    @github-actions
    Contributor

    This issue has been marked as stale due to 210 days of inactivity.
    It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

  4. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Apr 20, 2026
  5. amitbeck commented on Apr 25, 2026

    @amitbeck
    Author

    @targos was this was fixed in these commits?

  6. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Apr 26, 2026
  7. targos commented on Apr 26, 2026

    @targos
    Member

    I'm not sure, but since this is fixed in v24+, we can close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    i18n-apiIssues and PRs related to Node.js internationalization support.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions