Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Définir le fomat numérique

énumérer,toutes,les,cultures,disponibles
{filelink=19577}

using System;
using System.Globalization;
using System.Threading;
 
class FormatNumerique
{
  static void Main(string[] argv)
  {
      CultureInfo cultureFR = new CultureInfo(Thread.CurrentThread.CurrentUICulture.LCID);
      NumberFormatInfo fnFR = new NumberFormatInfo();
 
      fnFR = cultureFR.NumberFormat;
      fnFR.CurrencyDecimalSeparator = ",";
      fnFR.CurrencyGroupSeparator = ".";
      fnFR.NumberDecimalSeparator = ",";
      fnFR.NumberGroupSeparator = ".";
      cultureFR.NumberFormat = fnFR;
 
      CultureInfo FRCulture = new CultureInfo("fr-FR");
 
      cultureFR.NumberFormat = FRCulture.NumberFormat;
      Console.WriteLine(1598.ToString("c", cultureFR));
 
   }
}

No comments yet.

Leave a Comment