Skip to content

Support bigint type for Intl.NumberFormat.formatToParts #43799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
carlansley opened this issue Apr 23, 2021 · 1 comment · Fixed by #44015
Closed

Support bigint type for Intl.NumberFormat.formatToParts #43799

carlansley opened this issue Apr 23, 2021 · 1 comment · Fixed by #44015
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Milestone

Comments

@carlansley
Copy link

lib Update Request

Configuration Check

My compilation target is ES2020 and my lib is esnext.

Missing / Incorrect Definition

Intl.NumberFormat.formatToParts(number?: number).

The number parameter can also be a bigint.

Sample Code

This valid code:

Intl.NumberFormat([], {
  style: 'currency',
  currency: 'USD',
}).formatToParts(3500n);

Produces compiler error:

error TS2345: Argument of type '3500n' is not assignable to parameter of type 'number | undefined'.

Documentation Link

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatToParts

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Apr 23, 2021
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 23, 2021
@rastenis
Copy link
Contributor

I have opened a PR to address this issue: #44015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants