using System; class MainClass { public static void Main() { double num = 64354.2345; Console.WriteLine("Default format: " + num); Console.WriteLine("Display positive, negative, " + "and zero values differently."); Console.WriteLine("{0:#.#;(#.##);0.00}", num); num = -num; Console.WriteLine("{0:#.##;(#.##);0.00}", num); num = 0.0; Console.WriteLine("{0:#.##;(#.##);0.00}", num); } }
Default format: 64354.2345 Display positive, negative, and zero values differently. 64354.2 (64354.23) 0.00