refactor util.truncate to truncate to given char num