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