Boris Yasen
12/11/2024, 10:02 AMCeligo AI
12/11/2024, 10:02 AMAI generated answer (using internal Slack threads):In order to print a normal number into currency format in an advanced PDF template, you can use the Freemarker built-in function
?string.currency
. This function will format the number as a currency string.
Here is an example of how you can use it:
freemarker
${yourNumber?string.currency}
In this example, yourNumber
is the variable that holds the number you want to format. Replace yourNumber
with the actual variable name you are using in your template.
If you want to display the total with USD instead of $, you can concatenate the string "USD" with the number. Here is an example:
freemarker
${"USD" + yourNumber?string.currency}
Please note that the ?string.currency
function will round the number to two decimal places by default. If you want to control the number of decimal places, you can use the ?string("0.00")
function instead. Here is an example:
freemarker
${yourNumber?string("0.00")}
In this example, the number will be rounded to two decimal places.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
12/11/2024, 10:02 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.86801976
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840863645
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839846671
Celigo AI
12/11/2024, 10:02 AM