change getRoundNum to template function