Grazie DirK!
avevo un dubbio se usare print o sprintf.
Il tuo esempio calza a pennello!!