SOLVED

Currency field issue

Go to solution
Megan_Koelemay
Level 4

Currency field issue

Hi Community, 

 

I have a currency field that isn't displaying the way I'd expect it to.  For example, if the populated value is "$300.50" and I use a token to display it in my email content, it shows up as "$300.5"

 

Also, if the field value is supposed to have a comma, that won't show up in my email either - "$1,450.00" as the field value displays in my email's token as "$1450"

 

What are my options for forcing Marketo to display zeros and commas as you would normally expect for U.S. currency?

 

Thanks!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Currency field issue

Check all my posts about Velocity $number.format (in a Velocity {{my.token}} of course).

 

In this specific US case you can use the shortcut $number.currency($lead.field) because the default locale is en-US.

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Currency field issue

Check all my posts about Velocity $number.format (in a Velocity {{my.token}} of course).

 

In this specific US case you can use the shortcut $number.currency($lead.field) because the default locale is en-US.

duaneleem
Level 2

Re: Currency field issue

This is an even cleaner method. Thanks, Sanford!

Megan_Koelemay
Level 4

Re: Currency field issue

This worked perfectly - thank you, @SanfordWhiteman!

duaneleem
Level 2

Re: Currency field issue

Velocity scripting should help with that:

 

## Format the revenue value with a dollar sign and two decimal places
${number.format("$,${esc.h}${esc.h}0.00", 3000.5)}

 

Replace the 3000.5 with the email's token.  I used the NumberTool.  See screenshot of results

 

Screenshot 2024-06-05 114905.png

Screenshot 2024-06-05 115612.png

Tags (1)