If I have a double
, and want to round it down to the nearest quarter value (0.25), is this possible?
Each of these give me 0.5 and should actually give me 0.25:
Math.Round(0.499999, 2, MidpointRounding.AwayFromZero);
Math.Round(0.499999, 2, MidpointRounding.ToEven);
Is there any notion of always rounding "down"?
This question is related to "nearest" rounding. I don't need that
The "duplicate" is entirely based on NEAREST rounding. that is utterly irrelevant to me. I am not asking about NEAREST. I am asking about always rounding DOWN. Notice that 0.499999 is very NEAR to 0.5 - and that is not what I want. I want 0.49999 to become 0.25 (DOWN)