C# 小数点后保留两位小数,四舍五入的函数及使用方法
1 Math.Round(Convert.ToDecimal(45.367),2,MidpointRounding.AwayFromZero); //Returns 45.37 2 Math.Round(Convert.ToDecimal(45.365),2,MidpointRounding.AwayFromZero); //Returns 45.37
1 Math.Round(Convert.ToDecimal(45.367),2,MidpointRounding.AwayFromZero); //Returns 45.37 2 Math.Round(Convert.ToDecimal(45.365),2,MidpointRounding.AwayFromZero); //Returns 45.37