Currency Formatting in Email Scripts
I am trying to pull in a dollar AND cents amount into an email via a token. I have attempted to use the following email script to format the token and it is not working. I feel as though I am missing something minor. Thank you for any help!
## First, covert the variable to currency format
#set($total = $number.currency(${lead.your_field_here})) ##our code from before, e.g., $121,237.10
#set($stringLength = $total.length() - 3) ##get the total string length and calculate what we want to keep, e.g., 8 --note the specific spacing between the commands here! screwing up the syntax will crash it (e.g. if you remove the space)
#set($totalb = $total.substring(0,$stringLength)) ##takes the sub string of just the first 3 characters, e.g., $121,237
## Then, for the email output
${totalb}

Its showing as $1,980 not $1980.64 as it should.

Thanks again for any insight!