Math.Round : Math « System « C# / C Sharp by API






Math.Round

  

using System;

public class MainClass {
    public static void Main() {

        Console.WriteLine(Math.Round(4.4));
        Console.WriteLine(Math.Round(4.5));
        Console.WriteLine(Math.Round(4.6));
        Console.WriteLine(Math.Round(5.5));
        Console.WriteLine(Math.Round(4.54, 1));
        Console.WriteLine(Math.Round(4.55, 1));
        Console.WriteLine(Math.Round(4.65, 1));
        Console.WriteLine(Math.Round(4.56, 1));
    }
}

   
    
  








Related examples in the same category

1.Math.Abs
2.Math.Cos()
3.Math.Min
4.Math.PI
5.Math.Sign
6.Math.Sin()
7.Math.Sqrt
8.Math.Tan()