a nice function of converting integer from string