Hello all,

Has anyone tried using basic math operators in Velocity in Marketo? The documentation says I should be able to use simple arithmetic in my variables, but for some reason they do not work in Marketo.

I am trying to take take number fields and convert them to percentages for calculations in my email:

`#set( $test = ${lead.Some_Number_Field__c} / 100 ) `

However when I try to output ${test} it just outputs the variable in the email instead of the result.

I've found that if I use the Velocity **$math** function, I can get it to work, but it's just so tedious for simple operations:

`#set( $test = $math.div(${lead.Some_Number_Field__c},100 )) `

The above code does output a correct percentage (i.e. 35 => 0.35)

Anyone else have this experience?

Your curly braces are unnecessary.

But always use the MathTool methods, not operators, b/c the parser will fail (noisily or silently) in some cases, which is... bad.