Frontend Masters Boost RSS Feed https://frontendmasters.com/blog Helping Your Journey to Senior Developer Tue, 09 Sep 2025 19:18:20 +0000 en-US hourly 1 https://wordpress.org/?v=6.9 225069128 Unit Formatting with Intl in JavaScript https://frontendmasters.com/blog/unit-formatting-with-intl-in-javascript/ https://frontendmasters.com/blog/unit-formatting-with-intl-in-javascript/#comments Tue, 09 Sep 2025 19:18:20 +0000 https://frontendmasters.com/blog/?p=7101 Raymond Camden:

It’s been a little while since I last blogged about my favorite web platform feature, Intl.

Favorite?! Big words.

As someone who does technical writing, though, I get it. Let’s say you have a number, like 392, and you need to display that as megabytes. What is the absolutely correct way to show that in U.S. English? 392 MB? 392mb? 392mB? None of those, it’s actually 392MB in the “short” format and 392 megabytes in the “long” format. I like programmatically correct answers.

And better, you can change the locale and have it reformat as appropriate. Like it’s actually 392 MB for de-DE.

]]>
https://frontendmasters.com/blog/unit-formatting-with-intl-in-javascript/feed/ 1 7101