http://www.perlmonks.org?node_id=880213


in reply to Re^3: How to use the int-function?
in thread How to use the int-function?

kennethk, I've not yet found that printf would help me with formatting the output:

perl -e 'printf("%.2f\n", 1.255)'

-> 1.25

perl -e 'printf("%.2f\n", 1.455)'

-> 1.46

Although, there might be some option which jumps into the gap and helps to round the number?