October 2010
Intermediate to advanced
1920 pages
73h 55m
English
CultureInfo Class to Format String ValuesTo this point, the culture has been set at the level of an individual ASP.NET page or the level of an entire ASP.NET application. However, you might need to take advantage of locale-specific formatting at a more granular level. You can use the CultureInfo class to format a particular value independent of the Culture set for the page.
When you use the ToString() method to format dates, times, numbers, and currency amounts, you can supply an additional parameter that formats the value in accordance with a specific culture. For example, the page in Listing 30.9 formats two sets of date and time values.
Listing 30.9. ToStringCulture.aspx
The first date and time is formatted with German cultural ...