in reply to Re^2: Trimming of the decimal part.
in thread Trimming of the decimal part.

I know that int( ) is truncating the fractional part away, i.e. is always rounding down. The OP said: But I do not want the decimal part printed in the above output.. This means truncation to me. Maybe I took it to literal.

So far I can remember my last encounter with true rounding in Perl the sprinf function is really the best, like you already said. For other rounding functions like floor() and ceil() the POSIX module can be used.

Update:
Just tested sprintf("%d") and it truncates like int(). A function which implements "normal" rounding, away from zero from .5 starting is:

sub round ($) { return sprintf("%.0f", shift); }