Changing string to num with function and main