BigInt to BigInt.prototype.toLocaleString()
It returns a string representation of this BigInt object.
Example: The code creates a BigInt variable Big, converts it to a localized string, and prints it twice with different locale settings.
Javascript
let Big = 45334n; console.log(Big.toLocaleString()); Big = 78753456789123456789n; console.log(Big.toLocaleString( 'de-DE' )); |
Output
45,334 78.753.456.789.123.456.789
JavaScript Object toLocaleString() Method
The Object.prototype.toLocaleString() method returns a local specific string representation of this object using the locale of the environment. Derived objects like an array, number, date, typedarray, and BigInt can override this method.
Syntax:
object.toLocaleString()
Return Value: It returns a string representation of this object.
Objects overriding toLocaleString():
Contact Us