Course lesson

Format Numbers as Currencies Using Javascript Intl API

Numbers are another piece of information that have different ways to be formatted based on the different languages that users may use. One example of this is to display a value in different currencies.

Duration
3 min
Access
Free
Transcript
Retained from source evidence

Numbers are another piece of information that have different ways to be formatted based on the different languages that users may use. One example of this is to display a value in different currencies.

Currencies have not only different symbols but also different ways to punctuate or accommodate the numbers on them.

Javascript offers a way to handle this simply by just defining the language (locale) and the currency symbol you want to use. This API is Intl.NumberFormat