That's strange, I'm almost sure it existed o.O
Well, this is still better (by Exolent) than a contain check:
PHP Code:
stock bool:is_str_float(const string[])
{
new c, i, p;
while(is_char(c = string[i++]))
{
if(!isdigit(c))
{
if(c != '.' || p)
{
return false;
}
p = 1;
}
}
return (i > 1);
}