目录
博主是去年从零基础开始接触C#,所以记录了很多比较基础的东西,故将之前的笔记写于此篇。本人才疏学浅,文中如果有不对或值得讨论的地方,欢迎大家提出来,一起探讨共同进步。?????
Math.Round():实现中国式四舍五入(四舍六入五取偶)
Math.Round(Convert.ToDouble(EdtWeight.Text.Trim()) / Math.Pow(Convert.ToDouble(EdtHeight.Text.Trim()) / 100, 2), 1, MidpointRounding.AwayFromZero)
//1.Math.Round()
Math.Round(0.4) //0
Math.round(0.6) //1
Math.Round(0.5) //0
Math.Round(1.5) //2
Math.Round(2.5) //2
Math.Round(3.5) //4
Math.Round(4.5) //4
Math.Round(5.5