Hello, I've a problem with this freemarker script:
<#if risultato?is_hash>
<#if risultato.row?exists>
<#if risultato.row?is_sequence>
<#assign tmp = 0>
<#list risultato.row as x>
<#assign tmp = tmp+x.rank>
</#list>
<#else>
<#assign tmp = risultato.row.rank>
</#if>
</#if>
<#else>
<#assign tmp="no match">
</#if>
${tmp}
I would like to sum values contained into the variable risultato.row.rank and store it into the variable tmp
The problem is that this instruction <#assign tmp = tmp+x.rank> treats the numbers as string... so the output is a concatenated string like: 102.98129128.129387123 where the two numbers are:
102.98129 and 128.129387123
Which is the right sintax?