Get CultureInfo from data type : CultureInfo « I18N Internationalization « C# / CSharp Tutorial






using System;

using System.Globalization;

class MainClass
{
  static void Main(string[] args)
  {  
      int theInt = 0;    
    Console.WriteLine("IConvertible-ing System.Int32 to System.Byte");
    IConvertible itfConvert = (IConvertible)theInt;
    byte theByte = itfConvert.ToByte(CultureInfo.CurrentCulture);
    Console.WriteLine("Type code int converted to byte is: {0}", theByte.GetTypeCode());
    Console.WriteLine("Value of converted int: {0}", theByte);
  }
}
IConvertible-ing System.Int32 to System.Byte
Type code int converted to byte is: Byte
Value of converted int: 0








21.1.CultureInfo
21.1.1.Create CultureInfo: de-DE
21.1.2.Get current Culture
21.1.3.Create CultureInfo: en-US
21.1.4.Get CultureInfo from data type
21.1.5.Germany culture
21.1.6.Russian culture
21.1.7.Enumerates all available cultures
21.1.8.Get the current and current-ui cultures
21.1.9.Change the current cultures to Mexican Spanish
21.1.10.Create a CultureInfo object for the nl-BE culture
21.1.11.turkish-i problem
21.1.12.Format decimal for different CultureInfo