in reply to Where's that function

Since you are teaching yourself Perl, you really should get yourself a copy of "The Perl Cookbook" - another of the brilliant O'Reilly books. Pages 46 to 47 have exactly what you want.

As well as covering the sprintf / printf functions which others have mentioned, it also covers the int, floor and ceil functions.