00:00
00:00
Newgrounds Background Image Theme

Chan99 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

NaN 2006-08-08 13:45:48


How can I check if a number is NaN?
if(nNumber == NaN){ } just doesn't work.

Response to NaN 2006-08-08 13:47:24


At 8/8/06 01:45 PM, YoBro wrote: How can I check if a number is NaN?

How can I check if a number is NotaNumber?

Does not compute.


The water in Majorca don't taste like what it oughta.

| AS3: Main | AS2: Main | Flash Tutorials |

BBS Signature

Response to NaN 2006-08-08 13:48:09


At 8/8/06 01:45 PM, YoBro wrote: How can I check if a number is NaN?
if(nNumber == NaN){ } just doesn't work.

You could try: if(nNumber == "NaN"){ } (putting the NaN in quotes)?
Or: if(nNumber == undefined){ } (using undefined)

Hopefully one of those two methods work.


D:

BBS Signature

Response to NaN 2006-08-08 13:50:49


At 8/8/06 01:45 PM, YoBro wrote: How can I check if a number is NaN?
if(nNumber == NaN){ } just doesn't work.

Why you would want to check if a number is not a number?

Response to NaN 2006-08-08 13:59:41


At 8/8/06 01:50 PM, -Convery- wrote: Why you would want to check if a number is not a number?

Because I use String.charCodeAt(); and I want to check if it returns NaN or not.

Response to NaN 2006-08-08 14:08:00


Lol, got it to work.
if(nNumber != Number){ }

Response to NaN 2006-08-08 14:11:57


At 8/8/06 02:08 PM, YoBro wrote: Lol, got it to work.
if(nNumber != Number){ }

Would that really work correctly?
You should use typeOf nNumber
trace(typeOf nNumber) would trace 'number'.


BBS Signature

Response to NaN 2006-08-08 14:20:53


isNan(expression)

WHY THE HELL DID THAT TAKE HALF A DOZEN REPLIES TO FIGURE OUT?!?!?

Response to NaN 2006-08-08 14:26:52


At 8/8/06 02:20 PM, Fat_Lifeguard wrote: WHY THE HELL DID THAT TAKE HALF A DOZEN REPLIES TO FIGURE OUT?!?!?

None of us know what we're doing. Srsly, we don't. =/


The water in Majorca don't taste like what it oughta.

| AS3: Main | AS2: Main | Flash Tutorials |

BBS Signature

Response to NaN 2006-08-08 14:27:54


At 8/8/06 02:20 PM, Fat_Lifeguard wrote: isNan(expression)

WHY THE HELL DID THAT TAKE HALF A DOZEN REPLIES TO FIGURE OUT?!?!?

Why do you write with capitals?


BBS Signature

Response to NaN 2006-08-08 14:33:59


At 8/8/06 02:27 PM, ViktorHesselbom wrote:
At 8/8/06 02:20 PM, Fat_Lifeguard wrote: isNan(expression)

WHY THE HELL DID THAT TAKE HALF A DOZEN REPLIES TO FIGURE OUT?!?!?
Why do you write with capitals?

Sorry, I just sometimes get upset when a proplem with an easy answer takes so many people to figure out.

And I made a typo: It should be isNaN(), not isNan().

Response to NaN 2006-08-08 14:55:37


At 8/8/06 02:33 PM, Fat_Lifeguard wrote: Sorry, I just sometimes get upset when a proplem with an easy answer takes so many people to figure out.

try not to get upset. just because you knew the answer 8 replies back doesnt mean everyone else did. in fact, they clearly didnt, since they were offering replies that were just attempted workarounds. if that is what it takes to make you upset, you should just leave before you ever get to 100 posts.

your help, though appreciated, is not required around here. if these fora are going to negatively affect your blood pressure, do everyone a favor and just disconnect your computer from the wall.


BBS Signature