Choosing a Locale
Number formats are dependent on the locale ; that is, the country/language/ culture group of the local operating system. The number formats most English-speaking Americans are accustomed to use are a period as a decimal point, a comma to separate every three orders of magnitude, a dollar sign for currency, and numbers in base 10 that read from left to right. In this locale, Bill Gates’s personal fortune,[30] in Microsoft stock alone as of January 12, 1998, is represented as $74,741,086,650.
However, in Egypt this number would be written as:
The primary difference here is that Egyptians use a different set of glyphs for the digits through 9. For example, in Egypt zero is a and the glyph means 6. There are other differences in how Arabic and English treat numbers, and these vary from country to country. In most of the rest of North Africa, this number would be $74,741,086,650 as it is in the U.S. These are just two different scripts; there are several dozen more to go!
Java encapsulates many of the common differences between language/script/culture/country combinations in a loosely defined group called a locale. There’s really no better word for it. You can’t just rely ...
Get Java I/O now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.