Brian Dunning's FileMaker Custom Functions

ZeroLeading ( number ; numberOfDigits )

make a number a specific length by leading with zeros

  Average rating: 4.6 (25 votes) Log in to vote

Ignacio Yaselli   Ignacio Yaselli - Show more from this author
Carbon Crystal
https://www.carboncrystal.co.uk

Share on Facebook Share on Twitter

  Sample input:
ZeroLeading ( 13; 4)
  Sample output:
0013

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

This function uses recursivity to append as many zeros as required to the number.
The advantage of this method is that it does not require a "buffer" of any size...

 

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 15 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: