I am trying to found a float using math round I found the following
0.5 --> 0
1.5 --> 2
2.5 --> 2
3.5 --> 4
and so on. I believ
From documentation;
The integer nearest a. If the fractional component of a is halfway between two integers, one of which is even and the other odd, then the even number is returned. Note that this method returns a Double instead of an integral type.
Math.Round
method has some overloads that takes MidpointRounding as a parameter which you can specify the rounding value if it is midway between two numbers.
AwayFromZero
When a number is halfway between two others, it is rounded toward the nearest number that is away from zero.
ToEven
When a number is halfway between two others, it is rounded toward the nearest even number.