Long time since I did TCL but I believe the following will do what you want
puts stdout [format "i val %d '\x%x'" $i $i]
The %d and %x placeholders are almost the same as you would find in a C printf/sprintf statement and allow such things as leading zeros, field sizes etc