1×
Become a member
to unlock all features

Create egghead account to access 5000+ tutorials and resources from expert developers.

Create account
Autoplay

    Natively Format JavaScript Numbers

    javascriptJavaScript

    When needing to format a number I've tended to lean towards Number.prototype.toFixed(), reach for a 3rd party library, or write custom functions. However, with modern browsers, there's a lot of really interesting native capabilities you could start using with Number.prototype.toLocaleString()or Intl.NumberFormat.