How to total a list of numbers in FreeMarker
<p>I've been going through the <a href="http://freemarker.org/docs/dgui.html" rel="nofollow">documentation for FreeMarker</a> and I can't find any examples of how to sum up a list of values in a list. </p>

<p>So let's say I have the following class, how do I add a line at the end to include the totals of values:</p>

<pre><code>public class MyObject
{
    List&lt;long&gt; values
}
</code></pre>

<p>I can then view the individual items <a href="http://freemarker.org/docs/dgui_quickstart_template.html#autoid_4" rel="nofollow">as explained in the list directive</a>.</p>

<pre><code>&lt;#list MyObject.values as value&gt;
  ${value}
&lt;/#list&gt;
</code></pre>

<p>I can even find the <a href="http://freemarker.org/docs/dgui_template_exp.html#dgui_template_exp_arit" rel="nofollow">documentation on how to do arithmetic on the individual values</a> but how can I then add a new line to show the total of all the values? In other words I can't find any documentation on how to sum a list of numbers...</p>

<p>And also can you please include the link to the page in the documentation that explains how to do this. Thanks.</p>