Whoops! use %07.0f not %07d or you may suffer off-by-a-penny rounding errors.
Thanks mauke in irc.perl.org #perl-help