Why does this code produce the correct answer, except for the .000000001 at the end?
I have a DataGridView, that in a column has prices. This code goes down the grid, gets the values and adds them up.
double pp = 0;
for (int i = 0; i < PPUTDG.RowCount; i++)
{
try
{
pp = pp + Convert.ToDouble(PPUTDG[16, i].Value.ToString().Replace("$",""));
}
catch { }
}
I then call .ToString() on pp. The values should add to 6240.75, except I get 6240.75000000001.
Thanks.