-Lisa- Posted August 16, 2017 Posted August 16, 2017 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! Quote
GreggRusson Posted August 16, 2017 Posted August 16, 2017 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 Quote
-Lisa- Posted August 16, 2017 Author Posted August 16, 2017 Worked like a charm! Thanks so much, Gregg! Quote
Dan Korn Posted August 16, 2017 Posted August 16, 2017 return Field("ZIP").split('').join(' '); Quote
tou Posted August 17, 2017 Posted August 17, 2017 Do you need the actual spaces? If not, you can play with the tracking to "expand" or condense the spacing to mimic the coding........ Quote
GreggRusson Posted August 18, 2017 Posted August 18, 2017 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 Quote
Recommended Posts
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.