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.
This got be baffled for a moment, because the SI standard way to do it is with a space between the number and the unit (“392 MB”, not “392MB”.) It’s the “narrow” value that removes all spaces, here. If you use “short” there, it will show up with the correct space.