Use Currency Symbol in Advanced PDF Template

The total amount can be divided into symbol and integer parts in order to display the currency symbol in the Advanced PDF Template while calculating the amount using arithmetic operations. Once a variable has been assigned the symbol, print the currency symbol using that variable.

<#assign currencySymbol = record.total?substring(0, 1)> // This will store the currency symbol of field ‘total’ into the variable ‘currencySymbol’.

To display the currency symbol wherever needed use the variable currencySymbol.

For example:

<tr><td><#assign currencySymbol = record.total?substring(0,1)>

${currencySymbol} ${record.total – record.balance}</td></tr>

Here the currency symbol will display before the (total – balance) amount.

Ex: $1000

Leave a comment

Your email address will not be published. Required fields are marked *