Apologies, I am new to FreeMarker, but I have seen a number of entries in the 'Built-ins' for rounding numbers, but I can't seem to get them to work.
I have a custom column on my sales order that contains the item weight multiplied by the quantity. I can display this on the Advanced PDF form with this:
<td>${item.custcol1}</td>
I have tried variations of examples from the Built-ins documentation such as:
${item.custcol1?ceiling}
${item.custcol1?string.number}
${item.custcol1?string["0"]}
But none of these work, and many error on Preview.
I'm not clear on the difference between number and string fields, but would have expected one of these to work.
If it helps identify what type of variable this is, the following fields allow me to add up the weights down the list and show the total at the bottom:
<#assign weighttotal=0>
…..start of loop through list of items....
<#assign weighttotal=weighttotal + item.custcol1>
…..end of loop through list of items.....
${weighttotal}kg
Please can anyone offer any advice? To be honest, I probably only need to round the total figure (as I intend to remove the weights from each line once I am happy it is working correctly).