Convert string to integer

Thank you @ghudgins for the solution :grinning: