> But something like the "%.%de " %n is exactly what I am looking for - if I >could get it to work. Sorry my bad, I missed a % sign: >>> n=5 >>> "%%.%de" % n '%.5e' You need two %% to create a % in the output. Alan G.