Analyzer.AnalyzerBase.CalculateProgressInPercent C# (CSharp) Method

CalculateProgressInPercent() public static method

public static CalculateProgressInPercent ( Int32 calculationsCompleted, Int32 totalCalculations ) : Int32
calculationsCompleted System.Int32
totalCalculations System.Int32
return System.Int32
        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);
        }
    }