Used the following in a Pre Tcl:
set xlateOutVals [format “%06s” $xlateInVals]
Works like a charm, zero fills when MRN is 6 or less, does nothing if 6 or more… Used “s” (string) instead of “d” as the “d” would output funky numbers if the MRN was already leading with zeros, see below…
hcitcl>set x 0012
hcitcl>set y [format “%06d” $x]
hcitcl>echo $y
000010
hcitcl>set x 0012
hcitcl>set y [format “%06s” $x]
hcitcl>echo $y
000012