public static Int32 CalculateProgressInPercent
(Int32 calculationsCompleted, Int32 totalCalculations)
{
Debug.Assert(calculationsCompleted >= 0);
Debug.Assert(totalCalculations >= 0);
Debug.Assert(calculationsCompleted <= totalCalculations);
Int32 iPercentProgress = 0;
if (totalCalculations > 0)
{
iPercentProgress = (Int32)(100F *
(Single)calculationsCompleted / (Single)totalCalculations);
}
return (iPercentProgress);
}
}