# What does NaN mean?

0 favourites
• 16 posts
• I made a high score system following a tutorial but when i test it, it says NaN where the high score is suppose to be. Anyone know what that means and how to fix it?

• It stands for "Not a Number", implying that your high scores are invalid numbers. Which tutorial were you following? It's possible that the source of your high scores lacks actual score information, or has numbers represented as strings.

• I don't have enough reputation to post a link but it was the Arcade Style High Score in the Scirra tutorials.

• NaN is usually the result of unrepresentable mathematical calculations, like sqrt(-1), division by zero, etc. So check your expressions are right.

• It's also an indian flat bread.

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• It's also an indian flat bread.

That bread has double-a's, though At least in English.

• I didn't find anything wrong with it, but here's what my events look like.

WebStorage: Local Key "HighScore" exists: System: Set HighScore to WebStorage.LocalValue(HighScore)

System: Else: Set HighScore to 0

System: Score>HighScore: WebStorage: Set Local Key "HighScore" to Score

System: WebStorage: Local Key "HighScore" exists: System: Set HighScore WebStorage.LocalValue(HighScore)

highscore: Set text to "High Score" & HighScore

System: Else: System: Set HighScore to 0

highscore: Set text to "High Score" and HighScore

• you could try wrapping the high score call in an int() function which turns it back into a number..

int(HighScore) or int(WebStorage.LocalValue(HighScore) should convert it into a proper number if it's thinking it's a string.

• It's also an indian flat bread.

LOL

• WebStorage: Local Key "HighScore" exists: System: Set HighScore to WebStorage.LocalValue(HighScore)

You're making a mistake that the WebStorage manual entry warns about:

[quote:1q66ilhn]Note WebStorage only stores strings. If you set a key to a number like 100, when you retrieve it back it will be a string. To convert it back, use the system expression int, e.g. int(WebStorage.LocalValue("score")).

• Ashley whats going on with forum? i cant upload any images or capx. and i'm not the only 1 having this issue... :-s

• Coin-coin le Canapin test good too better then bread lol

• - Tom runs the web services, and you'd be better off asking in the website issues forum.

• Ah Not a Number I see.. I thought it was something like NAND

• In computing, NaN, standing for not a number,

• 16 posts