Hrmmm ... need some more details - are you always expecting to put 4 0's at the end? If so, it would be a simple:
$data = '001023'; sprintf ( "%s0000", $data ); Don't use %d in the printf() - that will strip away the leading 0's. Jason If memory serves me right, on Monday 21 January 2002 09:59, Geoff Ellis wrote: > could someone tell me how to pad right to left with spaces in a srintf > function.. > ie. how to convert "001023" into "001023ssss" where s is a space.. > > tia Geoff > > > _______________________________________________ > Perl-Unix-Users mailing list. To unsubscribe go to > http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users _______________________________________________ Perl-Unix-Users mailing list. To unsubscribe go to http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users