Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 71

Shane Smith
I hate code!
Profile
Posts: 37
Reg: Jun 19, 2012
Las Vegas
5,820
06/22/12 04:34 PM (13 years ago)

Formulas and Calculators

Best method for creating a simple calculator, based around an excel formula? I'd want to add an image to make it not so boring. Shane
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/22/12 04:37 PM (13 years ago)
JavaScript calculators running in an HTML Doc screen work exceedingly well. You can Google 'javascript calculator' and get tons of results you can use to model yours with. Mark
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
06/22/12 06:02 PM (13 years ago)
my last app was actually based on calculators, heres what i did to make a backround image for the calculator <TD WIDTH="100%" HEIGHT="100%" BACKGROUND="YOUR IMAGE LOCATION HERE" VALIGN="bottom">
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
06/22/12 08:42 PM (13 years ago)
@GoNorthWest some fun stuff coming from that search! David buzztouchmods.com
 
Shane Smith
I hate code!
Profile
Posts: 37
Reg: Jun 19, 2012
Las Vegas
5,820
like
06/23/12 04:41 PM (13 years ago)
Ok, I found bunches of groovy calcs, but still not sure I implement them to work within my app. Is their a tutorial for anything like this or should I just keep posting questions here. My questions are very newbie, but I am not really finding and other helpful resources explaining ow this is done. Can anyone point me in the right direction? For example how would I get the code below to look the same in the app as it does on a browser? <html> <form name="calculator"> <table border=4> <tr> <td> <input type="text" name="text" size="18"> <br> </td> </tr> <tr> <td> <input type="button" value="1" onclick="calculator.text.value += '1'"> <input type="button" value="2" onclick="calculator.text.value += '2'"> <input type="button" value="3" onclick="calculator.text.value += '3'"> <input type="button" value="+" onclick="calculator.text.value += ' + '"> <br> <input type="button" value="4" onclick="calculator.text.value += '4'"> <input type="button" value="5" onclick="calculator.text.value += '5'"> <input type="button" value="6" onclick="calculator.text.value += '6'"> <input type="button" value="-" onclick="calculator.text.value += ' - '"> <br> <input type="button" value="7" onclick="calculator.text.value += '7'"> <input type="button" value="8" onclick="calculator.text.value += '8'"> <input type="button" value="9" onclick="calculator.text.value += '9'"> <input type="button" value="*" onclick="calculator.text.value += ' * '"> <br> <input type="button" value="c" onclick="calculator.text.value = ''"> <input type="button" value="0" onclick="calculator.text.value += '0'"> <input type="button" value="=" onclick="calculator.text.value = eval(calculator.text.value)"> <input type="button" value="/" onclick="calculator.text.value += ' / '"> <br> </td> </tr> </table> </form> </html>
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
06/23/12 04:52 PM (13 years ago)
For starters can you get us the link where you got that code from? We'll help the best we can! David buzztouchmods.com
 
Shane Smith
I hate code!
Profile
Posts: 37
Reg: Jun 19, 2012
Las Vegas
5,820
like
06/24/12 03:14 PM (13 years ago)
Ok, Lets disregard that last code sent...I have moved away from it. Here is the link to the site that I am using to try to understand and build this simple calculator for my app. http://javascript.about.com/od/guidesscriptindex/a/calc.htm I got totally lost by step 5. Here is a link to the code I have written based on this site. https://dl.dropbox.com/u/3112854/battcalc.html The only thing I don't like about the current code I have is that I want the calculate button to live in the "total:" row. Not sure how to do that. I also need to add the formula...which is where I got lost. This is a simple formula: Units: = number multiplied by 2 Changes = number Days = number Total = Units x Changes x Days Can anyone help me out and get me headed in the correct direction? Thanks!!! Shane
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
06/24/12 04:34 PM (13 years ago)
Will take a better look at this in the morning Shane. David buzztouchmods.com
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.