in reply to Rounding numbers
If you want to round *all* numbers being written to a file then you may want to write a wrapper around that so you don't have to provide the printf format all the time. One way to do that would be by writing a sub-class of Tie::FileHandle::Base or you could write something based on Tie::STDOUT.$ perl -E 'say sprintf("%.2f", 5.5678)' 5.57 $ perl -E 'printf("%.2f\n", 5.5678)' 5.57
|
|---|