ds.Tables["table_name"].Rows[rownumber]Column[colnumber].ToString("#.00")

解决方案 »

  1.   

    set its format to "#.00"
      

  2.   

    好像不对,错误提示:重载“tostring”方法未获取“1”参数
      

  3.   

    System.Globalization.NumberFormatInfo nfi=new System.Globalization.CultureInfo( "en-US", false ).NumberFormat;
    nfi.NumberDecimalDigits=2;

    double myInt = 1234.567;
    string str= myInt.ToString("N",nfi);经过调试证明,显示的结果是1234.57,四舍五入了。
      

  4.   

    System.Globalization.NumberFormatInfo nfi=new System.Globalization.CultureInfo( "en-US", false ).NumberFormat;nfi.NumberDecimalDigits=2; //设置小数位数为2

    double myDouble = 1234.567;
    string str= myDouble.ToString("N",nfi);MessageBox.Show(str);经过调试证明,显示的结果是1234.57,四舍五入了。