No, this is not a mistake. Your logic says rounding twice, but you only have one call Round. 1.45 is less than the middle between 1 and 2 (1.5), therefore it is rounded to 1.
If you want the code to fit your logic, you can do this:
using System;
class Test
{
static void Main()
{
decimal d = 1.45m;
d = Math.Round(d, 1, MidpointRounding.AwayFromZero);
d = Math.Round(d, 0, MidpointRounding.AwayFromZero);
Console.WriteLine(d);
}
}
, ( ),.NET .