你先用string d="0.0"看看行不行

解决方案 »

  1.   

    double d = 0.0;
    你再输出
    string test = d.ToString();
    看看test的值
      

  2.   

    test = "0";
    问题是怎么转才能变成"0.0"??
      

  3.   

    我觉得只能加个判断了,
    string test;
    if(d==0)
    {
      test = "0.0"
    }
    else
    {
      test = d.ToString();
    }
    string[] arr = new string[2];
    arr = test.Split('.');
    TextBox1.Text = arr[1].ToString();
      

  4.   

    这样比较好:
    string test = d.ToString();
    if(test.IndexOf(".")<0)
    {
      test = test + ".0";
    }
    string[] arr = new string[2];
    arr = test.Split('.');
    TextBox1.Text = arr[1].ToString();