Culture-specific formatting : Culture Format : I18N Internationalization C# Examples


C# Examples » I18N Internationalization » Culture Format »

 

Culture-specific formatting









    
using  System;
using  System.Collections;
using  System.Collections.Generic;
using  System.IO;
using  System.Reflection;
using  System.Resources;
using  System.Text;
using  System.Threading;
using  System.Globalization;

public  class  MainClass
{
        public  static  void  Main()
        {
                decimal  money  =  1250.75m;
                string[]  cultures  =  {  "en-US",  "en-GB",  "ja",  "ar"  };
                Console.OutputEncoding  =  Encoding.UTF8;
                foreach  (string  culture  in  cultures)
                {
                        CultureInfo  cultureInfo  =  CultureInfo.CreateSpecificCulture(culture);
                        Console.WriteLine("{0}  =  {1}",  cultureInfo.DisplayName,money.ToString("C",  cultureInfo));
                }
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo I18N Internationalization
» Culture Format