in reply to formatting numerical output

my $blah = sprintf("%.2f", 3.1415926535); print "$blah\n"; __END__ prints 3.14

Keep in mind this doesn't round, only truncates decimals. If you want the result in two different variables (for the stuff before and after the decimal), split on /\./

blokhead