NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page profit calculator

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-16-2008, 01:35 PM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Apr 2008
Posts: 104
tanicos is an unknown quantity at this point
 



Help! profit calculator


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
tanicos is offline  
Old 07-16-2008, 01:43 PM   #2 (permalink)
NamePros Regular
Join Date: Apr 2008
Posts: 546
srigopaldaliya has a spectacular aura aboutsrigopaldaliya has a spectacular aura aboutsrigopaldaliya has a spectacular aura about
 



U just need to make an excel sheet with proper formulaes thats it.. No need to seperate tool to do this stuff.....
srigopaldaliya is offline  
Old 07-16-2008, 01:45 PM THREAD STARTER               #3 (permalink)
NamePros Member
Join Date: Apr 2008
Posts: 104
tanicos is an unknown quantity at this point
 



hello

i need it on a website page
tanicos is offline  
Old 07-16-2008, 02:08 PM   #4 (permalink)
NamePros Member
Join Date: Sep 2006
Posts: 99
Bruce_KD will become famous soon enoughBruce_KD will become famous soon enough
 



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>

????: NamePros.com http://www.namepros.com/programming/493467-profit-calculator.html
Bruce
Bruce_KD is offline  
Old 07-16-2008, 04:35 PM THREAD STARTER               #5 (permalink)
NamePros Member
Join Date: Apr 2008
Posts: 104
tanicos is an unknown quantity at this point
 




Originally Posted by Bruce_KD
Code:
<html>
<head>

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

????: NamePros.com http://www.namepros.com/showthread.php?t=493467
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
tanicos is offline  
Old 07-16-2008, 04:54 PM   #6 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



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.
nasaboy007 is offline  
Old 07-16-2008, 04:58 PM THREAD STARTER               #7 (permalink)
NamePros Member
Join Date: Apr 2008
Posts: 104
tanicos is an unknown quantity at this point
 




Originally Posted by nasaboy007
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
tanicos is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:28 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger