Skip to content

Support bigint type for Intl.NumberFormat.formatToParts #43799

Closed
@carlansley

Description

@carlansley

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions