Error In Template

When saving an Advanced PDF Template, user receives an error “The template cannot be saved due to the following errors: Error-left-hand operand: Expected a number, but this has evaluated to a hash+string” despite the fields having the correct formatting.

Expected a number, but this has evaluated to a hash+string

Solution:

Just declare the variable and assign the value of variable to ZERO using <#assign>

EXAMPLE

  <#if value?is_number>
          <#local retval = 0>
          <#local retval = value?string["#,##0.00"]>
		  <#local retval = retval?replace(",", " ")>
		  <#local retval = retval?replace(".", ",")>
          <#return retval>

Leave a comment

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