I'm looking for a more elegant way of padding integer values with leading zero's please
I'm currently using
set color [string map {10 10 11 11 12 12 13 13 14 14 15 15 2 02 3 03 4 04 5 05 6 06 7 07 8 08 9 09} $value]
to create a two digit mirc color value from an input integer value of 2 through 15 such that I can then use it, for example, to format output text
\003$color$text\003
It works fine but I'm just not happy with it. Maybe I'm just too fussy
I suspect there must be a way to use the TCL format command but I'm not well versed in C from which format seems to derive it's syntax