Skip to content

Intl.NumberFormat resolvedOptions style is wrong #39050

Closed
@snowystinger

Description

@snowystinger
  • Version: v14.17.0
  • Platform: Darwin *** 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:47 PDT 2021; root:xnu-7195.101.2~1/RELEASE_X86_64 x86_64

What steps will reproduce the bug?

(new Intl.NumberFormat('en-US', {style: 'percent'})).resolvedOptions() yields

{
  locale: 'en-US',
  numberingSystem: 'latn',
  style: 'decimal',
  minimumIntegerDigits: 1,
  minimumFractionDigits: 0,
  maximumFractionDigits: 0,
  useGrouping: true,
  notation: 'standard',
  signDisplay: 'auto'
}

How often does it reproduce? Is there a required condition?

every time

What is the expected behavior?

the style entry in the resolved options should be 'percent', not 'decimal'

What do you see instead?

Additional information

It was correct in node 12, 14.16.1, and 16.3
Sorry I didn't test more of them but the 14.16 -> 14.17 breaking should be helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    i18n-apiIssues and PRs related to the i18n implementation.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions