How to Format Compact Numbers with the JavaScript
![How to Format Compact Numbers with the JavaScript](https://www.freecodecamp.org/news/content/images/size/w2000/2023/01/Format-Compact-Numbers.png)
Sometimes it can be difficult to fit large numbers into your site or app's layout, especially if you have to display several of them together. As a result, a lot of modern sites and apps use the same format to display large numbers in a compact way. For example,
Sometimes it can be difficult to fit large numbers into your site or app's
layout, especially if you have to display several of them together.
As a result, a lot of modern sites and apps use the same format to display large
numbers in a compact way. For example, displaying 123,000 as 123K.
freeCodeCamp's and Instagram profiles using compact number format.You
can do this by writing a custom format function, using a third-party library,
or, best of all, using a built-in JavaScript API.
![](https://uploads.sitepoint.com/wp-content/uploads/2021/03/1615778552I18n-civ.jpg)
What is the JavaScript Internationalization API (I18n)? — SitePoint
![](https://www.w3docs.com/uploads/media/snippet_gallery/0001/05/d93687808af044e0ca436433ef168e8c6418df99.png)
How to Format a Number with Two Decimals in JavaScript
freeCodeCamp on LinkedIn: How to Format Compact Numbers with the
![](https://blog.openreplay.com/images/formatting-compact-numbers-with-javascript/images/hero.png)
Formatting Compact Numbers with JavaScript
![](https://taimoorsattar.com/static/414d9b78b835e83f1d832a6996c72378/79013/cover.jpg)
How to format input text while typing using Javascript?
Florin Lungu on LinkedIn: How to Format Compact Numbers with the
![](https://developer.mozilla.org/mdn-social-share.cd6c4a5a.png)
Intl.NumberFormat() constructor - JavaScript
GitHub - d3/d3-format: Format numbers for human consumption.
freeCodeCamp on LinkedIn: How to Format Compact Numbers with the
![](https://static.javatpoint.com/javascriptpages/images/javascript-format-numbers-with-commas5.png)
JavaScript format numbers with commas - javatpoint
![](https://data-flair.training/blogs/wp-content/uploads/sites/2/2019/08/JavaScript-Imprise-Calculation.jpg)
JavaScript Numbers - Get Skilled in the implementation of its Methods! - DataFlair
![](https://blog.coupler.io/wp-content/uploads/2021/06/Figure-27.-Displaying-a-compact-number-1024x367.png)
Looker Studio (Google Data Studio) Tutorial: Dashboard for Beginners
![](https://www.gerardhynes.com/social.png)
Gerard Hynes Software Engineer
![](https://static.raymondcamden.com/images/banners/numbers.jpg)
Using Intl for Short Number Formatting
![](https://cdn.educba.com/academy/wp-content/uploads/2020/02/Javascript-Number-Format-output-7.png)
Simple Method Used For JS Number Formats