winform中datagridview控件问题
double num15 = 0;
for (int i = 0; i < (a - 1); i++)
{
string value = Convert.ToString(dataGridView1.Rows[i].Cells[4].Value);
double num16 = Convert.ToDouble(dataGridView1.Rows[i+1].Cells[3].Value);
double num17 = Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value);
if (!string.IsNullOrEmpty(value))
{
num15 = num16 * Math.Cos(num17 * 180 / Math.PI);
}
dataGridView1.Rows[i].Cells[4].Value = num15.ToString();
}
代码如上,就是在datagridview控件生成的表格里面进行数据计算,但是它计算出来都显示为0是什么情况?
求教