SOLVED

Currency token and decimals...in a snippet

Go to solution
Anonymous
Not applicable

Currency token and decimals...in a snippet

Hello,

I need to display a currency database value in an email snippet.  I've inserted this value as a token.  However, when I send my test emails,  trailing zeroes are eliminated. 

For instance:

  • A field containing "1.50" in the database is displayed as "1.5" in the email
  • A field containing "1.00" in the database is displayed as "1" in the email

I understand there are velocity scripting solutions to format this number.  However, I don't think you can use velocity script tokens in a snippet?  Is there a way to have the token just be displayed as it appears in the database?

I'm thinking I may need to re-create the entire snippet logic in a velocity script?

1 ACCEPTED SOLUTION

Accepted Solutions
Grégoire_Miche2
Level 10

Re: Currency token and decimals...in a snippet

Hi Matt,

You cannot use a program token in a snippet, AFAIK (See and vote here: ​), so you will have to go full velocity, I am afraid.

The other possibility would be to use a proxy text field that you would populate from the currency field, for instance with a webhook.

-Greg

View solution in original post

4 REPLIES 4
Grégoire_Miche2
Level 10

Re: Currency token and decimals...in a snippet

Hi Matt,

You cannot use a program token in a snippet, AFAIK (See and vote here: ​), so you will have to go full velocity, I am afraid.

The other possibility would be to use a proxy text field that you would populate from the currency field, for instance with a webhook.

-Greg

Anonymous
Not applicable

Re: Currency token and decimals...in a snippet

Thanks for your response - I ended up just making that field a string.  While it's not great if I ever need to run operational logic against the value, this program didn't require it. 

Dan_Stevens_
Level 10 - Champion Alumni

Re: Currency token and decimals...in a snippet

Hi Greg - we use program tokens to display the current year in our email footer snippet:

pastedImage_0.png

...even though the email isn't physically located in a program (but the "send" smart campaign is).

Grégoire_Miche2
Level 10

Re: Currency token and decimals...in a snippet

Hi Dan,

Nice one. Therefore the idea above is useless, then. I was trusting it. The Buffet Formula : going to bet smarter than you woke up.

If a program token works in a snippet, then a velocity one should as well.

-Greg