Last Updated : 12 Jul, 2025
The BigInt.toLocaleString() method is an inbuilt method in JavaScript that is used to return a string with a language-sensitive representation of this BigInt.
Syntax:
bigIntObj.toLocaleString(locales, options)
Parameters: This method accepts two parameters as mentioned above and described below:
Return value: This method returns a string with a language-sensitive representation of the given BigInt.
The below examples illustrate the BigInt.prototype.toLocaleString() method in JavaScript:
Example 1: This example shows the use of the BigInt.prototype.toLocaleString() method in JavaScript.
javascript
<script>
let geekvar = 45334n;
console.log(geekvar.toLocaleString());
geekvar =78753456789123456789n;
console.log(geekvar.toLocaleString('de-DE'));
console.log(geekvar.toLocaleString('de-DE',
{ style: 'currency', currency: 'EUR' }));
console.log(geekvar.toLocaleString('hi'));
</script>
Output:
"45, 334" "78.753.456.789.123.456.789" "78.753.456.789.123.456.789, 00 €" "7, 87, 53, 45, 67, 89, 12, 34, 56, 789"
Example 2: This example shows the use of the BigInt.prototype.toLocaleString() method in JavaScript.
javascript
<script>
let geekvar =78753456789123456789n;
console.log(geekvar.toLocaleString('ar-EG'));
console.log(geekvar.toLocaleString('en-IN',
{ maximumSignificantDigits: 3 }));
console.log(geekvar.toLocaleString('zh-Hans-CN-u-nu-hanidec'));
console.log(geekvar.toLocaleString(['ban', 'id']));
</script>
Output:
"٧٨٬٧٥٣٬٤٥٦٬٧٨٩٬١٢٣٬٤٥٦٬٧٨٩" "7,88,00,00,00,00,00,00,00,000" "七八,七五三,四五六,七八九,一二三,四五六,七八九" "78.753.456.789.123.456.789"
We have a complete list of Javascript BigInt Methods, to check those please go through the Javascript BigInt Complete Reference article.
Supported Browsers: The browsers supported by BigInt.prototype.toLocaleString() method are listed below:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4