Class1.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:1k
源码类别:

C#编程

开发平台:

Others

  1. using System;
  2. using System.Globalization;
  3. using System.Threading;
  4. namespace Wrox.ProCSharp.Localization
  5. {
  6. class Class1
  7. {
  8. static void Main(string[] args)
  9. {
  10. int val = 1234567890;
  11. // culture of the current thread
  12. Console.WriteLine(val.ToString("N"));
  13. // use IFormatProvider
  14. Console.WriteLine(val.ToString("N", new CultureInfo("fr-FR")));
  15. // change the culture of the thread
  16. Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
  17. Console.WriteLine(val.ToString("N"));
  18. }
  19. }
  20. }