On a sidenote, you can replace $str(0,$calc([color:red]4- $len(%i)) $+ %i[/color] with $base(%i,10,10,[color:red]4)[/color]. $base is not used here for base conversion (inbase and outbase are both 10) but we make use of the [zeropad] parameter, which does exactly what you want; prefixes the input number with enough 0's so that the total length of the output is equal to [zeropad] (in this example 4).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com