Questions tagged [bankers-rounding]

31 questions
0
votes
1 answer

When specifying the number of decimals, is the behaviour of Math.Round with MidpointRounding.ToEven correct?

I'm trying to use Math.Round however the results I'm getting are not what I expected. I'm finding that it only rounds to even when the following digit is a 5 and cannot have any other digits after that. Assert.AreEqual(4d, Math.Round(4.5));…
kjbartel
  • 10,381
  • 7
  • 45
  • 66
1 2
3