在下面的简单代码中,给我Math.Round不同的结果。我错过了什么吗?
public static void Main()
{
double amt = 511.555;
double round = Math.Round(amt, 2, MidpointRounding.AwayFromZero);
Console.WriteLine(round);
//Returns 511.56
amt = 512.555;
round = Math.Round(amt, 2, MidpointRounding.AwayFromZero);
Console.WriteLine(round);
//Returns 512.55
Console.ReadKey();
}