Closed
Description
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
Playground Link: Link
Related Issues: