Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Creating Calculator- Troubles because + is doing this (7+3 = 73) instead of (7+3=10)

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 10-15-2006, 12:43 AM PM User | #1 KELS! New Coder   Join Date: Oct 2006 Posts: 46 Thanks: 1 Thanked 0 Times in 0 Posts Creating Calculator- Troubles because + is doing this (7+3 = 73) instead of (7+3=10) I've looked around a lot and all I've found is that I'm supposed to concatenate the string becuase JS is reading the + sign as just putting them together. Not adding. Code: function formula() { var costa = calculator.costa.value; var profita = calculator.profita.value; var yeilda = calculator.yeilda.value; var answer = Math.abs((costa + profita) / yeilda); calculator.ans.value = answer; return false; } The variable I'm having the trouble with is ANSWER. costa and profita are supposed to be added together, not just put next to each other. Here is the calculator: http://qualitygrainservices.com/calc.php I hope I gave enough information for everyone to sorta know what I'm having trouble with. If not please say something so I can give you more!
 10-15-2006, 12:53 AM PM User | #2 mrhoo Regular Coder   Join Date: Mar 2006 Posts: 719 Thanks: 34 Thanked 130 Times in 121 Posts Form values are always returned as strings, convert them to number format before math operations with parseFloat(value) or Number(value)
10-15-2006, 12:54 AM   PM User | #3
KELS!
New Coder

Join Date: Oct 2006
Posts: 46
Thanks: 1
Thanked 0 Times in 0 Posts
Quote:
 Originally Posted by mrhoo Form values are always returned as strings, convert them to number format before math operations with parseFloat(value) or Number(value)
Whoa. I have no idea what you said. I'm sorry! I just started all of this today...

 10-15-2006, 01:35 AM PM User | #4 KELS! New Coder   Join Date: Oct 2006 Posts: 46 Thanks: 1 Thanked 0 Times in 0 Posts Nevermind. I figured it out. I still have no idea what you were talking about though. Lol.

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 11:53 AM.