Modifying integer values to include commas | Community
Skip to main content
October 1, 2015
Question

Modifying integer values to include commas

  • October 1, 2015
  • 2 replies
  • 3169 views

Hello,

We have a field syncing from salesforce that usually represent large numbers eg. 11,056 --> however in marketo it shows as 11056 (without the comma) - Is there a way to modify these values in marketo to display with the commas. We want to use this field as a token in an email copy and it looks messy without the comma.

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Adobe Employee
October 1, 2015

Hi Abdallah,

As long as the field type is Integer, then it won't be able to accept the commas.  The Integer field type will only accept whole numbers.

What you could do instead is change the field type to String in Marketo.  It will then accept all characters.

To do this, you'll go to Marketo Admin > Field Management > (Search the field name) > Fields Actions (at the top) > Change Type.  The field cannot be in use when you do this, so you would need to remove it from an asset currently referencing it.  You can see those in the Used By list at the bottom of the field's information.

John

Josh_Hill13
Level 10
October 1, 2015

John,

Will this work in the sync if you pass back "11,052" as text to an integer field in SFDC? It sounds like it does, but I want to confirm.

Adobe Employee
October 1, 2015

Actually, this would not work.  The integer data type is pretty much the same between Marketo and SFDC, so the field on the SFDC side would not be able to accept the commas either.  I'm guessing that there is something going on with the way the field is displayed in SFDC that's showing the commas when a user looks at the field.

Daniela_Puizina
Level 2
June 20, 2019

@Sanford Whiteman‌ Hi Sanford - do you have a solution to the comma problem?

I'm trying to create this script which works but I don't know what to do about adding a comma. I can display the default value that I want to display with a comma when the value is over 25k but when it's under 25k that's where the problem occurs.

#set ($scorecap = $convert.toNumber(${lead.cap25}))

#if ( $scorecap > 25000)
$25,000
#else
${lead.cap25}

#end

SanfordWhiteman
Level 10
June 20, 2019

Please open a new thread and we'll continue there. Also pls highlight your code using the Advanced Editor's Syntax Highlighter (choose Java as the language as it's the closest to Velocity).