Strange problem with a C# function I am trying to write
<p>I have this function I am writing.</p>

<pre><code>  const int ProgressBarLength = 230;
  foreach (TransactionDetail item in list)
  {
      var itemProgress =
        ((ProgressBarLength/item.PurchasesRequired) *
        Convert.ToInt32(item.TransactionAmount));

      item.ProgressBar = itemProgress &gt; ProgressBarLength ? ProgressBarLength : itemProgress;
  }
</code></pre>

<p>Now I have 2 <code>TransactionDetail</code>s in my loop.</p>

<p>If <code>item.PurchasesRequired = 500</code> and <code>TransactionAmount = 199.0</code> the resulting value is 0. However, if <code>item.PurchasesRequired = 5</code> and <code>TransactionAmount = 94.0</code> it returns a valid result.</p>

<p>What am I doing wrong?</p>
