Is there a IsNumeric() Function ?

Get help using Construct 2

Post » 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

Post » 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
ImageImageImageImageImage
B
56
S
15
G
5
Posts: 852
Reputation: 11,436

Post » Wed Aug 05, 2015 9:21 am

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

Post » 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
13
G
4
Posts: 1,005
Reputation: 8,051

Post » 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;
}
ImageImageImageImageImage
B
56
S
15
G
5
Posts: 852
Reputation: 11,436

Post » 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
13
G
4
Posts: 1,005
Reputation: 8,051

Post » Sat Aug 08, 2015 1:51 pm

Can someone help me?
B
74
S
13
G
4
Posts: 1,005
Reputation: 8,051

Post » Mon Aug 10, 2015 10:58 am

Please!
B
74
S
13
G
4
Posts: 1,005
Reputation: 8,051

Post » 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
13
G
4
Posts: 1,005
Reputation: 8,051

Post » Mon Aug 10, 2015 7:23 pm

Glad you got it worked out. Thanks for sharing your solution.
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
22
S
6
G
1
Posts: 1,418
Reputation: 4,830


Return to How do I....?

Who is online

Users browsing this forum: adventurist and 25 guests