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

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