四舍五入
double num = 2600 * 0.001; double x = Math.Round(2.4, MidpointRounding.AwayFromZero); //结果为2 Console.WriteLine(x); x = Math.Round(2.5, MidpointRounding.AwayFromZero); //结果为3 Console.WriteLine(x); x = Math.Round(2.6, MidpointRounding.AwayFromZero); //结果为3 Console.WriteLine(x);