Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

Intl.NumberFormat.prototype.format()

2 tags 1 category

The format() method of Intl.NumberFormat instances formats a number according to the locale and formatting options of this Intl.NumberFormat object.

Number values in JavaScript suffer from loss of precision if they are too big or too small, making the text representation inaccurate. If you are performing calculations with integers larger than Number.MAX_SAFE_INTEGER you should use a BigInt instead, which will format correctly:

You can also pass through very large strings to be formatted as an arbitrary-precision decimal string (if you’re performing calculations on the data you will still need to work with BigInt):

Syntax example: format(number)

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…