# Is there a IsNumeric() Function ?

Get help using Construct 2

### » Wed Aug 05, 2015 7:17 am

Is there a IsNumeric() Function ?

E.g IsNumeric(Ajax.LastData)
B
12
S
3
Posts: 288
Reputation: 1,694

### » Wed Aug 05, 2015 7:32 am

There is isNaN () Function
Maybe try invert the isNan() function and it will be prove that is not Nan
B
59
S
17
G
5
Posts: 852
Reputation: 11,696

### » Wed Aug 05, 2015 9:21 am

isNaN () is the answer !
Thanks Naji !
B
12
S
3
Posts: 288
Reputation: 1,694

### » Thu Aug 06, 2015 12:07 am

@Toddler or @Naji

Coincidentally I'm looking for isNAN function to convert NAN results into 0. But I didn't find it. Any help? Thanks in advance.
B
74
S
14
G
4
Posts: 1,050
Reputation: 8,203

### » Thu Aug 06, 2015 7:55 am

RenatoB wrote:@Toddler or @Naji

Coincidentally I'm looking for isNAN function to convert NAN results into 0. But I didn't find it. Any help? Thanks in advance.

Check if a variable or global variable or an array isNaN () , if so just set this number to zero

example : (Hope you understand because I'm a coder)
If ( isNaN(Array.at(index))) {
Array.at(index) = 0;
}
B
59
S
17
G
5
Posts: 852
Reputation: 11,696

### » Thu Aug 06, 2015 12:41 pm

Hi @Naji

I understood but I don't know how to implement it in the C2. I tried to use "compare 2 values" for this (If TextField.text equal ...) but not worked. I also didn't find any reference about this function in the manual.
B
74
S
14
G
4
Posts: 1,050
Reputation: 8,203

### » Sat Aug 08, 2015 1:51 pm

Can someone help me?
B
74
S
14
G
4
Posts: 1,050
Reputation: 8,203

### » Mon Aug 10, 2015 10:58 am

B
74
S
14
G
4
Posts: 1,050
Reputation: 8,203

### » Mon Aug 10, 2015 4:40 pm

If anyone needs to avoid the "NaN" (not a number) result, just use the "is Value Type" conditional (System > is Value Type). If is "NaN", change the result for what are you want. I hope it helps someone.
B
74
S
14
G
4
Posts: 1,050
Reputation: 8,203

### » Mon Aug 10, 2015 7:23 pm

https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,867