Calculator With Percentage Button?
Apr 7, 2011
so i am working on a calculator but i am having trouble with the % buttonif i do 200*50% it should be 100, but now it says 0.5the function code:
function PercentButton() {
if(NewNumber != "blank") {
Number2 *= .01;
[code]....
View 2 Replies
ADVERTISEMENT
May 24, 2011
Dont know if it can be done but.... I am using the percentage calculator
<SCRIPT language=JavaScript>
<!--
//Script by Tom Richardson Jr.
[code]....
View 2 Replies
View Related
Feb 15, 2010
Wondering if someone could help me out. i am developing a simple javascript calculator at the problem is this:When I use the input type = button or submit, then the calculator works fineBUTI need to use a custom button and now the calculator just shows the results for a split second and then disappears and the form reloadsHere is my code:
<html>
<head>
<script language="JavaScript">
[code]....
View 13 Replies
View Related
Feb 21, 2011
I have a simple form on my artwork website that allows a customer to enter a numer of prints and a number of colours and then calculates a price of the order (for their curiosity only - that is the end of the function).I have now changed the way I have priced my orders and want to make it so that, for instance, if a customer wants 2 prints it will be �150.00 (�75 per print) but 3 prints will be �195.00 (65 per print) and so on the more they order.What I want to do is to add a list of prints from 1 to 10 with a radio button next to each. the user can then select 5 prints.The way my form works right now (see code below) is that the customer enters a numeric value and then the javascript takes the value and multiples by a pre-set "PrintAmount" value.Because that value is constant - I can't make multiples of prints different values (or can I ?) Heres my javascript (form below):
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
<!--
[code]....
View 26 Replies
View Related
Oct 16, 2010
I need to make a button that will display my name in the answer box of my calculator.
Can anyone please show me the code to do this?code...
View 1 Replies
View Related
Oct 9, 2010
I have a JavaScript calculator, here is the code:
<script type="text/javascript">
var num1=prompt('Enter your first number',"");
var num2=prompt('Enter your second number',"");
var problem=prompt('Enter the operator you wish to use..x,X,+,-,/ are valid..',"");
if (problem=="+")
{
[Code]...
It will open when the page comes up, but how do I put it so that it opens when the user clicks a button?
View 9 Replies
View Related
Nov 2, 2011
I am using a JavaScript price calculator. Right now it does everything I need except for one thing.
If you look at the "type" field, they can choose either woven or printed. Right now, if they choose "woven" it adds 6 cents to to the total as you can see in this portion of the code:
if (theForm.select.value=="woven") {
priceeach+=0.06;
Rather than 0.06, how do I get it to add a percentage--say 20%
The form is located here: [URL]
View 3 Replies
View Related
Jun 9, 2006
I am going to use javascript to calculate a value depending on what the user selects from a dropdown menu.
I have 2 columns in a table and a dropdown menu. The value in the 2nd column is going to be calculated by taking a percentage of the number that is hardcoded in the 1st column.
The user will select an option from the drop down e.g. 10% 20% 30% etc... and the value in the 2nd column will be calculated according to the percentage of the value in the 1st column.
View 1 Replies
View Related
Jan 26, 2010
I have divs on a page that are placed in the center with something like
width:100px;height:100px;position:fixed;top:50%;left:50%;margin:-50px, 0, 0, -50px;
I want to animate this div to the bottom left (similar tominimizingeffect on windows)
I am trying to use.animate({
opacity: 0.25,
left: '10px',
bottom: '10px';
height: 'toggle'
}, 5000);
However when I activate this it simply jumps (or glitches) to that position, the opacity and height animate perfectly.
View 1 Replies
View Related
Oct 27, 2010
I have a problem in my code which is as follows:
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
[code]....
My problem here is that I am calculating the percentage values of a whole number and storing those values in text boxes respectively through javascript function.Now,what I need is that I want to round all the values to integer value such that the sum of integer values is equal to the final value.
View 2 Replies
View Related
Sep 21, 2009
I am having an issue with converting my decimal to a percentage. Below is my code:
(cost * .06) is where the issue is
var cost = prompt("What is the cost of your purchase?", "")
document.write("Return Value: "+cost,("<br />"));
var salestax = cost * .06
document.write("Return Value: "+salestax,("<br />"));
var total = cost + salestax
document.write(cost + salestax);
View 3 Replies
View Related
Apr 12, 2011
I want to calculate the percentage of a number, but I'm getting a really weird result. In the following code f is equal to 3 and x.length is equal to 8. The part that isn't working is emphasised in bold. Basically 3/8 * 100 should result in 37.5 but the result I am getting with the following code is 7934570.3125. How do you calculate this percentage in Javascript?
function displaymember()
{
var m = 1;
[code]...
View 7 Replies
View Related
Mar 23, 2010
I am writing a form and doing a bunch of calculations one of which is a percentage based on the value selected. I am returning a correct result for two of the values but for the other two I am not.The 'discount' value is what I am looking for. It should return as 0 for values of 1 but it is doing the math as though it is multiplying by 1. And again for the value of 6 it should be 10% but is taking the value as 4.6 or something.Code is below I've included all of it (sorry) for better ease of understanding the math that is happening:
HTML Code:
<form id="form1" action="" method="get">
<fieldset>
<p>[code]......
View 3 Replies
View Related
Oct 27, 2010
I have a problem in my code which is as follows:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
[code]....
My problem here is that I am calculating the percentage values of a whole number and storing those values in text boxes respectively through javascript function.Now,what I need is that I want to round all the values to integer value such that the sum of integer values is equal to the final value.
View 3 Replies
View Related
May 27, 2011
I'm working with a style.filter related function.Some of my function appear as ...
Code:
document.getElementById('audio').style.filter = 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#A8' + c.substring(1) + ',endColorstr=#A8' + c.substring(1) + ')';
Everything is working but I'm trying to replace the "A8" part with a percentage typed in by the viewer.The percentage is simply a non-decimal number between 0 and 100 typed into a box.I know how to grab the value of the box (again, it's 0-100) but how do I convert that number into it's "A8" equivalent?
View 3 Replies
View Related
Dec 16, 2006
I am wondering if anybody can provide statistics what is percentage of visitors with disabled JavaScript.
Even more interesting would be statistics of users with disabled JavaScript making a purchase. I am more likely to purchase from my home than from work and I think the disabled JS is mostly result of IT dept. policies.
Is e-commerce site missing much if requires JavaScript?
View 7 Replies
View Related
Apr 4, 2011
I'm stuck on how to calculate the payment fee of 1.61% on top of the membership price. Also, how do I round the figures to 2 decimal places?Here's the Javascript so far:
<script type="text/javascript">
var member_prices = new Array();
member_prices["no"]=235.00;[code].....
View 10 Replies
View Related
Dec 1, 2011
I am implementing a zoom in feature, but actually tricking the user as a full screen image is simply being stretched.
I plan to apply it to several pages, and don't really fancy working out the pixels for each.
I believe that if you simply put width: 150% height 150% it will change the image size relative to the browser. I don't want that, I want it relative to the original image size. Could I do sort of height*1.5 or something? How would I write that if so?
<script>
$('#in').click(function() {
$('#drag img').animate({
width: '150%',
[Code]....
View 2 Replies
View Related
Mar 25, 2009
I didn't write much of this code, but basically, it opens an image in a new window. The problem is that the new window can either be the whole page, or a certain set size. I would like to make the window height and width determined not by a pixel number, but by a percentage of the size of the image I am opening in the new window.
here is the piece of code I think is pertinant.
// Strip file name from image src
var spath=targ.getAttribute('src');
wholePathLength=spath.length;
strippedPathLength=spath.substring(0,spath.lastIndexOf("/")).length;
[Code]....
View 10 Replies
View Related
Sep 21, 2009
How can i "prompt the user for the sales tax rate as a percentage"? this is what i have so far....
var tax = prompt("What is your tax rate percentage?", "")
document.write("Return Value: "+tax,("<br />"));
View 2 Replies
View Related
Jan 11, 2010
I am trying to customize this scrollbar so that it will fit all screen resolutions and I was wondering how I could do this by somehow customizing the JavaScript files created by Nathan Faubion or if I could do this using other JavaScript variables (var widthPercentage) to change the pixels to percentages?One of the pages on the website I'm using the JavaScript on
JavaScript file jsScroller.js:
//Created by Nathan Faubion http://www.n-son.com/scripts/jsScrolling/
function jsScroller (o, w, h) {
[code]....
View 6 Replies
View Related
Mar 26, 2010
I'm setting position left to 100% and it works except in Chrome/safari. These browsers set it about 100px from the left not 100%obj.css('left', '100%');Setting the css by itself <img src="" style="left:100%;position:absolute" works fine.I don't know if this is a browser problem or a jquery problem.
View 1 Replies
View Related
Oct 4, 2009
I am working on an Mpg calculator and I am stuck.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
I have a mistake when it is suppose to calculate.
View 4 Replies
View Related
Mar 25, 2011
I'm trying to make a calculator app; with a few differences. I have a text field with a numberpad below it, I got the numbers to show up in the text field, but am unsure as to how when I hit the enter button - it would store them in a variable?...I am also wondering as to how it would store current value and then allow me to input another value(maybe on the next page) and either subtract or add to it(the first value that is stored).I am also wondering how to get a decimal point in place(need it for currency).
Here is my code:
<html>
<head>
<script type = "text/javascript">
[code].....
View 10 Replies
View Related
Dec 2, 2011
I have the last assignment that she wants us to do and I had to pull up another assignment that she wanted us to build upon( which is one of those coding without anything advance)
<html>
<head>
<title>
[code]....
now she wants us to do max <beta and then name the variables with if a<b and I don't know if I put that in the concatenation or what to name my variables!
View 18 Replies
View Related
Jan 4, 2007
I am trying to create a price calculator that automatically calculates the price of custom made picture frame. I got an equation that finds the square area of the frame by multiplying the perimeter (2*length*width) by the thickness (which the user can choose from 1.5", 2" or 3"). Then it multiplies it by a decimal number (0.27 if the frame is 1.5" thick, 0.23 if its 2" thick, and 0.18 if its 3" thick). Then it adds a $5 custom made fee to the final answer. But when I save it to an html file and load it in Internet Explorer, it doesn't calculate. Code:
View 5 Replies
View Related