title: Calculating Percentage in C#
body: <p>What am I missing here while attempting to calculate the percentage complete?  My percentage equation seems to return an incorrect percentage.</p>
  
  <pre><code>Int32 counter = 0;
  
  foreach (var vehicle in vehicles)
  {
      counter += 1;
  
      Int32 percentage = (Int32)((double)counter * vehicles.Count()) / 100;
  
      _worker.ReportProgress(percentage);
  
  
      if (_worker.CancellationPending)
      {
          e.Cancel = true;
          _worker.ReportProgress(0);
          return;
      }
  }
  </code></pre>