use Number::Format qw(:subs); print format_number(123456, 2, 1); # print 123456 with two decimals, fill with 0s