A Guided Garden Stroll through the .NET Framework Class Library
Namespace: SYSTEM.GLOBALIZATION
● I am the Globalization Namespace and I am used for helping your .NET applications become global citizens.
Where I am particularly useful is in formatting numbers and currency values. In a web application, for example, you can get the preferred culture information of the end user, and based on their setting, I can format your amounts for you. I’ll put in the British Pound Symbol, the Russian Ruble, or Italian Lira, etc., when its appropriate to do so.
Not only that, but I’ll translate into the culture of your choice, the month names and weekday names.
By creating my CultureInfo* class and giving it an abbreviation of the culture name, such as "en-AU" for English-Australia, then passing this object as input to the Threading.Thread.CurrentThread.CurrentCulture, I then force all standard formatting of numeric variables and dates in your application to display correctly for that culture.
To get a list of all the culture abbreviations available, like "en-AU", you can call my CultureInfo.GetCultures method.
The System.Drawing name spaces think they’re quite cool, but I am very cool myself.
Did I mention that I also have a set of Calendar classes? These classes know how to divide time into the given culture’s recognized units.
For example, I can provide you with the following calendar classes:
If you’ve noticed, every ToString method which exists on every .NET object will take an object of type IFormatProvider. Well, my CultureInfo class implements that interface, so it is a valid object to pass to all of your ToString calls which will then provide you with the proper formatting.