I would like to sum up the total cost in a GSP page ,i get now a list of all values. im using the code below:
<g:each in="${costList}" var="cost">
<tr>
<td>${cost.amount}</td>
</tr>
</g:each>
How can I do that in grails GSP page. thanks!!
This should do it:
${costList.sum { it.amount } }