I have a series of custom fields that I created and set them to field type currency. I set up an alert email to notify sales of what was filled out in the form however the formatting for the numbers are not coming through. Example: 5000 is not coming through as 5,000. How do you make the number format to currency (add in the comma and decimal). I thought by selecting currency field this would happen.
Hey Amanda,
Based on comments in this similar thread, Annual Revenue Token I believe the best solution is using a velocity script token as opposed to using the basic field token.
Check out the comment made by Sanford Whiteman at the bottom.
Sincerely,
Keith Nyberg
Keith is correct, you must use Velocity. Currency merely means a certain type of Float internally, it doesn't directly have anything to do with how something is printed.
Hi Sanford Whiteman thanks for writing back! Here is my token that is in my email for the currency field: $ {{lead.$1 Buyout 12 Month Payment:default=}}. In the code I need to update the token with the velocity scripting correct? So the code change would be; from:
THIS <td valign="top" style="padding: 5px 10px; border-top: solid 1px #d0d0d0; font-size:16px; line-height: 1.75; font-family: Arial, Tahoma, Helvetica, sans-serif;"> $ {{lead.$1 Buyout 12 Month Payment:default=}} </td>:
TO: <td valign="top" style="padding: 5px 10px; border-top: solid 1px #d0d0d0; font-size:16px; line-height: 1.75; font-family: Arial, Tahoma, Helvetica, sans-serif;"> $ ${esc.d}${number.format(lead.$1 Buyout 12 Month Payment:default=} </td>
?
This is all new to me so any help would be appreciated!
Meant to note, in the discussion Keith shared above the velocity code example didnt have 2 brackets like standard tokens do {{}}. Wasnt sure if that was a typo or on purpose?
Amanda, you may be confused about where Velocity code (Velocity Template Language, or VTL) goes.
If you post VTL (or any code, including JS or CSS) here for inspection, make sure you use the Advanced Editor's syntax highlighter:
Thanks Sanford! Yes I was confused, but that makes sense.
Thanks again!