title: Coldfusion Calculate Sum Total (Loop? )
body: <p>ok. so i have this table:</p>
  
  <p>|item| quantity| price|</p>
  
  <p>|apple  |  2 | 2.00 |<br>
  |orange |  3 | 1.50 |<br>
  |grape  |  5 | 2.50 |<br></p>
  
  <p>i want to display the <strong>Grand Total</strong> that a customer has to pay.
  how to do that? <code>enter code here</code>
  i don't really know how to use array. can anyone show me how?</p>
  
  <p>my code (sort of)</p>
  
  <p>
  the price is shown in each of the row using this query:</p>
  
  <pre><code>&lt;cfquery name="getPrice" datasource="fruits"&gt;
  select *
  from fruits
  &lt;/cfquery&gt;
  
  &lt;cfloop query="getPrice"&gt;
    #quantity# | #price# | #totalPrice#
  &lt;/cfloop&gt;&lt;br&gt;
  </code></pre>
  
  <p>the Grand Total should be displayed in the last row (Grand Total =$ 21.00 ).</p>
  
  <p>Thanks for your help.</p>