AmazonScrape.SearchManager.GetPercentComplete C# (CSharp) Method

GetPercentComplete() public method

Returns integer percentage of overall progress, based on the number of retrieved and validated results.
public GetPercentComplete ( ) : int
return int
        public int GetPercentComplete()
        {
            // NumberOfResults is validated in the UI to be > 0
            // Catch DBZ error anyway (would result in end of search if error)
            int percent = 100;
            try
            {
                decimal resultsCount = (decimal)_validResultCount;
                decimal totalResults = (decimal)_searchCriteria.NumberOfResults;
                percent = (int)((resultsCount / totalResults)*100);
            } catch
            { }

            return percent;
        }