infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Tcl Library
if inbound is less than 6 characters zero fill to 6 char
Gina Borden
I would like to add a pre-tcl on my Copy statement in my xlate, that if this number is less than 6 characters, then add 0's to the beginning of it until it reaches 6 characters.
I'm not sure of the easiest way to do this. Any help would be greatly appreciated.
Thanks,
Gina
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
Gina,
We have a proc we use here that I think will do what you want.
If you want it, email me and I will send it to you.
Charlie Bursell
A proc seems like overkill to me Jim.
Why not simlpy
set num [format %06s $num]
Note the use of s instead of d incase of empty string it would come out 000000. If you use d the empty string would give a Tcl error.
Jim Kosloskey
Charlie,
Thanks - I did not know about the s instead of d.
Always good input.
Max Drown
Cahrlies, the "s" instead of "d" tip is very good to know. I suggest adding that to your tips and tricks presentations.