isnumeric
#1

Код:
stock IsNumeric(const string[])
{
	for (new i = 0, j = strlen(string); i < j; i++)
	{
    	if (string[i] > '9' || string[i] < '0') return 0;
	}
	return 1;
}
how make this code to check float numbers?
Reply
#2

Use sscanf.

pawn Код:
return !sscanf(string, "{f}");
Reply
#3

Quote:

stock IsNumeric(const string[])
{
return !sscanf(string, "{f}")
}

correct?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)