DEV Community

Wojciech Wernicki
Wojciech Wernicki

Posted on • Originally published at wojciech.space on

#TIL WebAPI: Intl.NumberFormat

Picture displaying formatted money value "123.456.79 €" in the center of picture and JavaScript logo in the bottom

The Intl object is the namespace for the ECMAScript Internationalization API, which provides language sensitive string comparison, number formatting, and date and time formatting. The Intl object provides access to several constructors as well as functionality common to the internationalization constructors and other language sensitive functions.1

Recently I found very handful function for formatting numbers, currency or units — Intl.NumberFormat, which formats values for given language and region.

Documentation: Intl.NumberFormat on MDN

Sources:


  1. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl 

Top comments (0)