I want to add the following What is required when the number is half i.e. 200.5. Whether 200 or 201? By default Math.Round
follows MidpointRounding.ToEven
enumeration value.
double number = 200.5;
Console.WriteLine (Math.Round(number,0));
Console.WriteLine (Math.Round(number,0, MidpointRounding.AwayFromZero));
double number2 = 201.5;
Console.WriteLine (Math.Round(number2,0));
Console.WriteLine (Math.Round(number2,0, MidpointRounding.AwayFromZero));
//The output from the above code will be
//200
//201
//202
//202
So, if the next higher number is required always, when the value is half way, then MidpointRounding.AwayFromZero
is to be used.