I am trying to show the percentage complete in the console:
Console.Clear();
Console.SetCursorPosition(0, 0);
Console.Write("Progress: ");
Console.Write(int_current);
Console.Write(" of ");
Console.Write(int_total);
Console.Write(" ( ");
Console.Write((int_current / int_total) * 100);
Console.Write(" %) ");
As the code runs, I can see the int_current
increasing as expected, but the (int_current / int_total) * 100
remains at 0%
until int_current
and int_total
are the same value. At that point, it shows 100%
.
What have I done wrong?