use real() function(https://docs.yoyogames.com/source/dadiospice/002_reference/strings/real.html) function.

Also note that real converts to a number with decimals. So, real("8.72") will not result in an integer, but a float. If you suspect that the string might not contain an integer, use floor() or round() after that, like so: floor(real("8.72"))