C # formatted output

using System;
using System.Collections.Generic;
using System.Text;

the ConsoleApplication1 namespace
{
  class Program
  {
    static void the Main (String [] args)
    {
      Double n-= 10.0 /. 3;
      Console.WriteLine (n-);
      Console.WriteLine ( "{0: 0.00}", n-); // Reserved two decimal
      string str = n.ToString ( "0.000" ); // switch to three decimal string containing
      Console.WriteLine (STR);
      the Console.ReadKey ();

    }
  }
}

Output:

 

Guess you like

Origin www.cnblogs.com/zhaiyh/p/11129529.html