Brian Dunning's FileMaker Custom Functions

ZeroLeading ( number ; numberOfDigits )

make a number a specific length by leading with zeros

  Average rating: 4.6 (27 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

Tulsi Ram Bhalotia   Tulsi Ram Bhalotia
Sep 15, 2019
Thanks it works fine.
 
Jason Maskell   Jason Maskell
Mar 9, 2020
Does the job. Quick and easy.
 

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: