Currency token and decimals...in a snippet | Community
Skip to main content
March 1, 2018
Solved

Currency token and decimals...in a snippet

  • March 1, 2018
  • 1 reply
  • 2808 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Grégoire_Miche2

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

1 reply

Grégoire_Miche2
Grégoire_Miche2Accepted solution
New Participant
March 1, 2018

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

March 1, 2018

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.