Globalize your Web Applications: PHP's Locale Formatting Classes
Dec 29, 2009, 05:37 (0 Talkback[s])
(Other stories by Rob Gravelle)
"In programming, a locale is a set of parameters that define
attributes for a user's specific geographic location, including the
user's language, country and any special variant preferences that
the user wants to see in his/her user interface. In Part 1 of the
Globalize your Web Applications series, we examined what the locale
entails, how they are supported by different operating systems, and
we looked at some specific implementations in PHP. The Part 2
article continued with the PHP language as we explored how to make
your dates locale aware, using both the native datetime functions
as well as the I18N_DateTime class. Today, we'll be covering PHP's
two remaining I18N Libraries, the I18N_Number and I18N_Currency
classes, both of which are subclasses of the I18N_DateTime
function.
"Formatting numbers
"Just as dates and times can vary greatly depending on the
country, numbers are also written differently in different
languages. For instance, the number 123456.789 would be written as
123 456,789 in German. Here are some LCIDs and their associated
number formats for various languages and countries:"
Complete Story
Related Stories: