Coercing strings into a number

Hey, I have a string that ends up being something like “0:09.92” and I want it to be a number. Is there any was (maybe a regular expression) where I can get the last 3 numbers of that string (9.92) and make them into a double type integer. Or maybe just get the number brfore the second . (9) and make that into a number?


Please use the OS X forum unless your question deals specifically with an older application or Mac OS version. Moving to OS X…

An integer doesn’t have any decimals.

Try something like this:

set test to "0:09.92"

set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
	set test to (last text item of test) as real
end try
set AppleScript's text item delimiters to ASTID

--> 9.92