Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Leading Zeroes To A String 1

Status
Not open for further replies.
Aug 9, 2006
17
GB
This should be a straightforward enough question but I am having some problems resolving it.

I have a string value which contains numbers which I need to pad with leading zeroes if the number is less than 4 digits in length i.e if the value has 1 digit it needs 3 leading zeroes and if it is 2 digits it needs 2 leading zeroes.

What is the best way to go about this?

Many thanks.
 
Try:

totext(val({table.string}),"0000")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top