镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

BigInt.toLocaleString does not have any arguments, and Intl.NumberFormat does not support formatting BigInt #36970

Closed

Description

@MelnCat

TypeScript Version: 3.7.x-dev.201xxxxx

Search Terms:
bigint
bigint format
bigint numberformat
Code

console.log((2000n).toLocaleString("fr"));
console.log(new Intl.NumberFormat("fr").format(3000n));

Expected behavior:
The code runs without errors, and "2 000" and "3 000" is logged to the console.
Actual behavior:
The code fails to compile, with the errors

Expected 0 arguments, but got 1. ts(2554)
Argument of type '3000n' is not assignable to parameter of type 'number'. ts(2345)

It shouldn't fail. Reference
ECMA Specification
image

Playground Link: Link

Related Issues:

Activity

  1. locked as resolved and limited conversation to collaborators on Oct 21, 2025
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

    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