You appear to be dealing with sizes of files. In that regard, you should really be dividing by 1024 to get sensible values.
my $size = sprintf '%d', ((stat($file))[7]) / 1024;That will give you what you want. Oh, I nearly forgot, if you are looking for human-readable sizes, this has been covered in pretty print bytes.
In reply to Re: Rounding numbers output
by grinder
in thread Rounding numbers output
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |