I'm trying to carry out a conversion from a string to a double. I have values like "000.2" or "000.7". I'm trying to use them for a chart. But when I use y = Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value);
and the actual value of the dataGridView is "000.7" the output will be 7????
I do not understand this.
int rows = dataGridView1.RowCount;
int x;
double y;
for (int i = 0; i < rows; i++)
{
x = Convert.ToInt32(dataGridView1.Rows[i].Cells[1].Value);
y = Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value);
this.chartHorizontal.Series["Horizontal"].Points.AddXY(x, y);
}
Maybe someone knows what goes wrong here?
Suggested thread doesn't show me what goes wrong.