Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Graphics Forum


You are currently viewing our Graphics Forum as a guest. Please register to participate.
Login



Reply
How to sum strings containing numbers...
Old 05-21-2006, 05:19 PM How to sum strings containing numbers...
Junior Talker

Posts: 1
Trades: 0
Hi, I have an array of numbers. When I pass them to a textbox with the + as delimitator, I cannot get to sum them. It says "NAN". I know it means that it is not a number...but how can i get it to work?

Thanks
Lama is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-25-2006, 06:10 PM Re: How to sum strings containing numbers...
vectoreyes's Avatar
Novice Talker

Posts: 11
Location: Romania
Trades: 0
To tell flash that a variable is a number use:

Number(YourVariableName);

Example:

results = Number(MyVariableName) + Number(AnotherVariable);

It is a generally a good idea if you use strict data typing when declaring a variable, like this:

var MyVariable:Number = 1;
vectoreyes is offline
Reply With Quote
View Public Profile Visit vectoreyes's homepage!
 
Reply     « Reply to How to sum strings containing numbers...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11256 seconds with 12 queries