sub round_to_nths { my ($num, $n) = @_; (int $num*$n)/$n }