Dynadot โ€” .com Transfer

Profit calculator

Spaceship Spaceship
Watch

tanicos

Established Member
Impact
0
hello

can anyone point me in the right direction? searched google but no luck
what i need:

a profit calculator to:
Ex: people can calculate their profit for selling stuff.
Number of people: 20
Number of dvds: 10
Number of books: 10

Total profit 12000$

now here is the math: when they add 10 dvds this will be multiplied with 32$
when they add 10 books it will be multiplied with 28$
so 32*10=320$+280$(10*28)=600$ * 20people=12000$

Can someone tell me?thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
U just need to make an excel sheet with proper formulaes thats it.. No need to seperate tool to do this stuff..... :)
 
0
•••
hello

i need it on a website page:)
 
0
•••
Code:
<html>
<head>

<script type='text/javascript'>
function calc() {

  var cost_dvd = 32;
  var cost_book = 28;

  document.getElementById('total').innerHTML = Math.floor(document.getElementById('people').value) * (Math.floor(document.getElementById('dvds').value) * cost_dvd + Math.floor(document.getElementById('books').value) * cost_book);
}
</script>

</html>

<body>

People: <input type='text' size='3' id='people' onkeyup='calc();' value='0' /><br />
DVDs: <input type='text' size='3' id='dvds' onkeyup='calc();' value='0' /><br />
Books: <input type='text' size='3' id='books' onkeyup='calc();' value='0' /><br /><br />
Total: $<span id='total'>0</span>


</body>
</html>


Bruce
 
0
•••
Bruce_KD said:
Code:
<html>
<head>

<script type='text/javascript'>
function calc() {


Bruce
i can't thank you enough...is there a way to add a button which says calculate instead of automatic result? thanks a lot
 
0
•••
take out the onkeyup="calc();" from the 3 <input>s and add an <button onclick="calc();> and you SHOULD get the same result, except on button click.
 
0
•••
nasaboy007 said:
take out the onkeyup="calc();" from the 3 <input>s and add an <button onclick="calc();> and you SHOULD get the same result, except on button click.
thank you very much too :wave:
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back