I am experimenting with the Math.Round
class and I am having problems getting it to do what I want it to do. Basically I have the following code:
double test = 1.675;
double rounded = (double)Math.Round((decimal)test, 2, MidpointRounding.ToEven);
Console.Write(rounded);
Console.ReadKey();
I want rounded
to be 1.67, where 1.675 is rounded down to 1.67. Instead, my current output is:
1.68
I thought MidpointRounding.ToEven
forced it to round to the nearest even (.005 -> .000)?