Derive Number Format info from culture info : CultureInfo I18N : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » CultureInfo I18N »

 

Derive Number Format info from culture info









    


using System;
using System.Globalization;
using System.Threading;


class Class1 {
  static void Main(string[] args) {
      CultureInfo MyCulture = new CultureInfo(Thread.CurrentThread.CurrentUICulture.LCID);
      NumberFormatInfo Vnf = new NumberFormatInfo();

      Vnf = MyCulture.NumberFormat;
      Vnf.CurrencyDecimalSeparator = ",";
      Vnf.CurrencyGroupSeparator = ".";
      Vnf.NumberDecimalSeparator = ",";
      Vnf.NumberGroupSeparator = ".";
      MyCulture.NumberFormat = Vnf;

      CultureInfo FRCulture = new CultureInfo("fr-FR");


      MyCulture.NumberFormat = FRCulture.NumberFormat;
      Console.WriteLine(123456.ToString("c", MyCulture));

   }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» CultureInfo I18N