银行家舍入的规律:四舍六入五考虑,五后非零就进一,五后为零看奇偶,五前为偶应舍去,五前为奇要进一
Math.Round() ——银行家舍入
Math.Round(4.5, MidpointRounding.AwayFromZero) = 5 ——实现四舍五入
Math.Round(4.5111, 2,MidpointRounding.ToEven) ——保留2位小数
MidpointRounding.AwayFromZero:When a number is halfway between two others, it is rounded toward the nearest number that is away from zero
MidpointRounding.ToEven:When a number is halfway between two others, it is rounded toward the nearest even number.