in reply to clever zero _right_ pad?

There is no such thing as"padding by zero" from the right.

Since you want to print a different number, might as well compute it with something like:

$new=$val * 10**(10-int(log($val)/log(10)));
Hmmm.. now that i look again, you wanted it for strings. tye++!