Brian Dunning's FileMaker Custom Functions

PaddedText ( Source ; FillChar ; NumberOfChars )

Pads a text string to a specific number of characters using a fill character.

  Average rating: 4.4 (32 votes) Log in to vote

Andrew Sasaki   Andrew Sasaki - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
PaddedText (1; "0"; 2)

PaddedText (12; "0"; 2)

PaddedText ("Hello"; "x"; 8)

PaddedText ("Hello World!"; "x"; 8)
  Sample output:
"01"

"12"

"xxxHello"

"Hello World!"

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Will add fill characters to text until the text is the desired length. Can be used to add leading zeroes to digits, etc. -- see cample input and output for examples. All outputs are text. It also has the following characteristics:

-Accepts integers as the source text

-If no fill character is supplied, the default is a space

-If the length of the source string is longer than the target length, the source string is unaltered

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: