$num =~ s/\.(\d).*/.$1/; # perform the rounding (as string)