Expressions help

M

mwh

Hi.

I am using Javascript to make a kind of calculator. I am trying to do
addition, but when I use it, it just displays the numbers together, not
added together. Example:
function additionCalculator(num1, num2){
var total = num1 + num2
return total
}

I try to add the numbers, but it just puts them together.

Also, I am trying to use subtraction and division, but I do not know
how.

Can anybody help?

(____)
(\/)
/-------\/
/ | Mwh ||
- ||----||
 
G

Gazza

mwh mumbled the following on 05/05/2005 02:21:
Hi.

I am using Javascript to make a kind of calculator. I am trying to do
addition, but when I use it, it just displays the numbers together, not
added together. Example:
function additionCalculator(num1, num2){
var total = num1 + num2
return total
}

I try to add the numbers, but it just puts them together.

Also, I am trying to use subtraction and division, but I do not know
how.

Can anybody help?

Amazing what you can find if you type in Javascript adding numbers into
Google...
http://homepage.ntlworld.com/kayseycarvey/variables4.html
 
N

nice.guy.nige

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top