Jump to content

Recommended Posts

Posted

Anyone know of a way to add a space between all characters of a field? I have a numeric field where a space is required between each and every character. It's a Zip Code field so the majority of the records will contain five digits.

 

Thanks!

Posted

Put this into a rule:

 

var ZipWithSpaces = "";

 

for(var idx = 0; idx < Len(Field("ZIP")); idx++) {

 

ZipWithSpaces += Field("ZIP").substr(idx,1) + " ";

 

}

 

return Trim(ZipWithSpaces);

 

Gregg

Posted
Do you need the actual spaces? If not, you can play with the tracking to "expand" or condense the spacing to mimic the coding........
Posted

To Dan,

 

Great response, clear, concise and compact.

 

To Tou,

 

After posting my 'down and dirty' response, I had the same thought on tracking tags. It wasn't clearly defined 'why' the extra space was needed, but you're right. If there was a reason the spacing between the characters needed some kind of exacting tolerance, that would have been the way to go.

 

Gregg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...