C#中常用方法是Math.Round(),但它并不是我们熟悉的四舍五入,而是四舍六入五取偶
Math.Round(20.123, 2) //Returns 20.12
Math.Round(20.345, 2) //Returns 20.34
Math.Round(20.355, 2) //Returns 20.36
Math.Round(20.456, 2) //Returns 20.46
若要求四舍五入,可增加一个参数
Math.Round(20.345, 2, MidpointRounding.AwayFromZero);//20.35