Parse state string into number