Function convertStringToNumber