We are a breed of human beings committed to develop applications; these must be practical, efficient and easy to use. Several hundred thousand of us—probably more in the region of several million—are pursuing the ultimate application. If only one of them reaches the goal—perhaps shared by several thousand—that will be enough for final users; they do not need more developers working on something they already have!
But some environments are definitely better than others. As developers, we need to cope up with representing numbers—accounting and other sorts. As you, the reader, may already know by now, a quantity like this:
Will be represented in different ways, depending on the region of the world where the web page visitor is located:
- USA: 34,497.68 (Notice the rounding)
- UK: 34.497,68 (Rounding, again, but commas and periods have been exchanged)
France, Germany or Spain follow rules that are different from the rules followed by countries in America, Asia or Africa.
And that is the part about representing numbers. Just think about the part representing Dates!
Computers store dates and numbers in binary structures. As web visitors open pages from different parts of the world, numbers and dates are expected to appear according the reader’s geographical location.
If developers read carefully developers.mozilla instructions, it will all work just fine! Right?
It will not work fine simply because people at Apple Computers, those who designed iPhones and iPads and the iOS (operating system) that runs them, decided to laugh at regional needs!
The following function works well in MSIE, Chrome and FireFox; however, it is simply ignored by Safari:
The purpose of that line of code is simply to present—print, show—a number value in the proper way, according to where the page is being shown. That code effectively shows the proper format when using any of the following browsers:
- Chrome (under Android, Windows 8.+)
- FireFox (under Android, Windows 8.+)
- MSIE (under Windows 8.+ in a PC)
Both, Chrome and FireFox fail when their iOS versions are used, including MACs.
And Microsoft… What about Microsoft? Here we go:
var nfr = new Intl.NumberFormat(ltag,lpat);
Instead of this part (less efficient):
Which is less efficient and takes up more CPU time. Fortunately, we are talking about the CPU of the machine where the web browser is being used. But because Microsoft decided not to implement object Intl, the millions of web browsers opened all over the world, must use more CPU power, that somebody—the Planet, the rest of us—must pay for.
To Microsoft Internet Explorer: Those hundreds of programmers in Redmond are incapable of implementing the correct Intl function in your browser?
It is the time of millions of programmers and developers that is stolen daily by the negligence and lack of responsibility of those to-make-money organizations.
That is one of the mechanisms that make the small human individual remain economically small; just one more reason to advocate for the zeitgeisty idea of ending the money model for good!