title: calculate percent difference python
body: <p>I am trying to get something to work on a form i am building for my job and it doesn't seem to be working the way i expect it to. </p>
  
  <p>I want to calculate the percent difference between the two fields <code>ANL_CMA1_NUM_CLOSED_SALES</code> and <code>ANL_CMA2_NUM_CLOSED_SALES</code>.</p>
  
  <p>I thought my math was correct but i am only getting results in single digits, either positive or negative depending on the inputted values.</p>
  
  <p>I am working on a form where i can customize permission level and rounding, and i am rounding this to the nearest hundredth.  Can anyone help me with this one?</p>
  
  <p>The original formula did not have the <code>-100) * 100)</code> portion at the end of it but also did not work properly.</p>
  
  <pre><code>FormSet.SetFieldValue(CurrentForm, "ANL_CHG_NUM_CLOSED_SALES", 
  (((FormSet.GetFieldValue(CurrentForm, "ANL_CMA2_NUM_CLOSED_SALES") - 
  FormSet.GetFieldValue(CurrentForm, "ANL_CMA1_NUM_CLOSED_SALES")) /    
   FormSet.GetFieldValue(CurrentForm, "ANL_CMA1_NUM_CLOSED_SALES")) -100) * 100)
  </code></pre>