EDIT:
Actually, I think your example might be a little off. Wouldn't you want price to be a double and quantity to be the int? Your array declarations seemed to be off as well, since those aren't valid declarations.
I just did this, without typecasting at all and total stayed a double:
-
double total = 0;
-
double[] Qty = new double[10];
-
Qty[0] = 1.1;
-
Qty[1] = 4.5;
-
Qty[2] = 9.7;
-
Qty[3] = 2.6;
-
Qty[4] = 0.7;
-
-
int[] price = new int[10];
-
price[0] = 1;
-
price[1] = 4;
-
price[2] = 3;
-
price[3] = 7;
-
-
for (int i = 0; i < 9; i++)
-
{
-
total += Qty[i] * price[i];
-
}
-
Total was a double just fine. So I am thinking in your ACTUAL code there is something else wrong?