Multiply it by four, round it as you need to an integer, then divide it by four again:
x = Math.Round (x * 4, MidpointRounding.ToEven) / 4;
The various options for rounding, and their explanations, can be found in this excellent answer here :-)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…