<@UEUDUCPB4> I got this function from <@U29QCJQF3>...
# advancedpdf
r
@_nikhilpalli I got this function from @michoel to convert the strings to numbers in freemarker before doing math.
Copy code
<#function toNumber val>
  <#if val?has_content && val?length gt 0 >
       <#return val?html?replace('[^0-9.]','','r')?number >
  <#else>
     <#return 0 >
  </#if>
</#function>
👍 2
b
What's the syntax for calling a function?
r
${<function name>(<params>)}
👍 1
b
Like this?
Copy code
${toNumber(field_id)}
r
yes
b
Thank you
u
thank you!