四舍五入

 static void Main(string[] args)
        {

            //int d = GetInt("4.5");
            int d = (int)Math.Round(2.5,MidpointRounding.AwayFromZero);

            decimal kk = Convert.ToDecimal("3.2");

            //int dd = int.Parse(d);
            int result;

            int.TryParse("2.3", out result);
            int kkd = result;

           int dp = (int)Math.Round(4.5);
           //double ll =Math.Floor(2.5);
         
        }

posted @ 2009-07-29 13:59  许晓光  阅读(287)  评论(0编辑  收藏  举报