title: How do you Round a Sum SQL
body: <p>I'm grabbing a sum from a database and using the sum to populate a js script that shows a donation thermometer of the progress.  </p>
  
  <pre><code>Current Dontations: &lt;?php
  global $wpdb;
  $results = $wpdb-&gt;get_results('SELECT SUM(purchase_value) AS sum_total FROM wp_cmxi_edd_customers');
  $var ='$total';
  $total   = 0;
  foreach ($results as $result):
     $total = $result-&gt;sum_total;
      break;
  endforeach; 
  ?&gt;
  &lt;tr&gt;
      &lt;td&gt;&lt;?php echo $total;?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>The js: </p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
              var currentAmount = '&lt;?php echo $var ;?&gt;';
   &lt;/script&gt;
  </code></pre>
  
  <p>The problem is, it's returning NaN becuase I need to round the number to remove the decimals.  How do you ROUND and SUM at the same time? </p>