I am sorry, but using the int function does not give you proper rounding.
$ perl -e 'print int(.678*100)/100;'
0.67
The result for .678 should be 0,68, not 0.67. The int can certainly be used for building a rounding subroutine, but not with the code presented, it is quite more complicated.
| [reply] [d/l] [select] |
I understand it is not "proper" rounding. I had the feeling the poster just wanted a quick way to "truncate" the answer to 2 decimal places when printing to an output file.
| [reply] |