Type casting

I’m trying to compare data from a parsed string to a number. I get an error which I think comes from trying to compare the string to a number:

local data = split("1.2,7.4,2.4",","); if (data[2] > 5.0) { ...

How do I typecast the string (data[2]) as a float?

From the Squirrel reference manual:
tofloat() converts the string to float and returns it

ie, data[2].tofloat()