Get CultureInfo from data type : CultureInfo : I18N Internationalization C# Examples


C# Examples » I18N Internationalization » CultureInfo »

 

Get CultureInfo from data type









    
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);
    }
}
    
   
  
   



Output

IConvertible-ing System.Int32 to System.Byte
Type code int converted to byte is: Byte
Value of converted int: 0


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo I18N Internationalization
» CultureInfo