Advanced PDF/HTML templates allows simple computations through the use of the Freemarker language. For instances where values needs to be compared or displayed on a certain format, the Freemarker language has a built in function that converts the type casting of variables.
Solution
- Navigate to Customization > Forms > Advanced PDF/HTML Templates
- Preferred Advanced PDF/HTML Template: Click Edit
- Create a variable to store the sum of the fields by using the below code:
<#assign totalSum = var1 + var2>Copy - Convert the variable to currency by using the below code:
${totalSum?string.currency}Copy - Click Save