根据需要看看
double dd;
System.Math.Round(dd,2);
System.Math.Celling(dd,2);
System.Math.Floor(dd,2)
哪个是你想要的

解决方案 »

  1.   


    double a = 3212.4499944444999449409887;
    string bx = "";
    for(int i = 0;i<5;i++)
    {
    bx += a.ToString()[i];
    }
    int cx = Convert.ToInt32(a);
    string dx = string.Format("{0:f2}",a);
    Console.WriteLine("a "+a);
    Console.WriteLine("bx "+bx);
    Console.WriteLine("cx "+cx);
    Console.WriteLine("dx "+dx);
    如果数字太长如上,则Convert.ToInt32(a)不可使之转换