Culture formatting : Culture Format : I18N Internationalization C# Examples


C# Examples » I18N Internationalization » Culture Format »

 

Culture formatting









    
using  System;
using  System.Globalization;

class  MainClass
{
    public  static  void  Main()  
    {
        DateTime  dtNow  =  DateTime.Now;
        Double  curOriginal  =  12345.67;

        CultureInfo  ci  =  new  CultureInfo("en-US");
        string  sLocalizedDate  =  dtNow.ToString("d",  ci);
        string  sLocalizedCur  =  curOriginal.ToString("c",  ci);

        //  print  them  out
        Console.WriteLine(sLocalizedDate);
        Console.WriteLine(sLocalizedCur);

    }

}
    
   
  
   



Output

3/25/2007
$12,345.67


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo I18N Internationalization
» Culture Format