Reply To: Anyone got a zero fill (left) tcl proc or fragment?

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Anyone got a zero fill (left) tcl proc or fragment? Reply To: Anyone got a zero fill (left) tcl proc or fragment?

#56740
David Caragay
Participant

You might want to check out the format command.  

hcitcl>set x “123456”

hcitcl>set x1 ”  3456″

hcitcl>set x2 “3456”

hcitcl>set y [format “%06d” $x]

hcitcl>echo $y

123456

hcitcl>set y [format “%06d” $x1]

hcitcl>echo $y

003456

hcitcl>set y [format “%06d” $x2]

hcitcl>echo $y

003456

Forum Statistics

Registered Users
5,115
Forums
28
Topics
9,291
Replies
34,426
Topic Tags
286
Empty Topic Tags
10