Questions tagged [jquery-calculation]

101 questions
0
votes
2 answers

jQuery set var to 0 in a form

I'm so close to create my form i need. But there is still a "bug". I wan't create a form where a customer can calucate how expensive something will be. I'm sure there are a lot of shorter ways to build the whole thing, but this is not the question.…
0
votes
2 answers

Javascript calculate the sum of all input fields with a specific class

Okay, i have this code which is working fine to a specific point. $(document).ready(function(){ var val1 = +$(".charge").val(); var val2 = +$(".fee").val(); var val3 = +$(".loadrate").val(); …
0
votes
1 answer

calculation with select option value using javascript

I have query related to javascript that we call a function where is id in select option tag. So can we use this id for calculation in other function? how to get this id? If yes then how? If no then please give me some other idea.. How to read this…
Isha
  • 27
  • 6
0
votes
1 answer

Javascript checkbox calculation

I am trying to build a form calculation javascript that works fine with radio buttons, but I haven't been able to make it work with checkboxes. The form includes a domain whois check, which generates checkboxes with the name 'domain' and the value…
0
votes
1 answer

Calculation in Javascript without rounding decimal numbers

Guys I got a text box wherein users may enter valid decimal numbers. And later I have to do calculations with this decimal number without rounding it. Currently I am working as var pricePerItemExVat = Math.round($("#InnerCaseWsp").val()) /…
Nishant Rambhojun
  • 67
  • 1
  • 1
  • 10
0
votes
1 answer

Calculation using Javascript

var pricePerItemExVat = parseInt($("#ConsumerWSP").val()) / parseInt($("#ConsumerItemSellUnit").val()); var pricePerItemIncVat = pricePerItemExVat + (pricePerItemExVat * parseInt($("#pricingConsumerVat").text())); var consumerPor =…
Nishant Rambhojun
  • 67
  • 1
  • 1
  • 10
0
votes
3 answers

Jquery - .toFixed(2) fixed number reduce to 3 digits

I have the following code that works with the exception of limiting the #result2 to 3 digits current #result2: input 1 and you get 0.010416666666666666 needed #result2: input 1 and get 0.01 I need to limit the result to 0.00 2 digits after so that…
AlwaysLearning
  • 187
  • 3
  • 5
  • 12
0
votes
1 answer

Subtract values in table with similar class name

I have a table in which I want to subtract values in columns. However, instead of subtracting the values it keeps adding up. jsFiddle. HTML:

Contract Amount

input
  • 7,214
  • 23
  • 91
  • 143
0
votes
3 answers

Two dimensional array help output a value

I have a form where users can ship pallets for fixed costs depending on their location. Currently this is for UK and France. For each country they are spilt up into 4 zones. So we have a table like this: I was thinking the best way to do this is to…
0
votes
3 answers

Calculate From To Time Difference - Total Work Time

I need to calculate time difference 24Hrs Time. some thing seems wrong in the code if ( shiftToMin >= shiftFromMin ){ shiftTotalMin = shiftToMin - shiftFromMin; if( shiftFromHr < shiftToHr ){ shiftTotalHr = shiftToHr -…
epynic
  • 792
  • 2
  • 10
  • 21
0
votes
1 answer

Subtract from parent rows

I'm trying to subtract the value of parent header rows (which are the sum of their respective child rows) but it just keeps on adding while displaying the minus symbol. How do I subtract? jsFiddle HTML:
input
  • 7,214
  • 23
  • 91
  • 143
0
votes
1 answer

Calculate sum of all columns

I want to calculate the sum total of the parent rows in all the columns. Here's what I'm doing right now [jsFiddle]: HTML:
input
  • 7,214
  • 23
  • 91
  • 143
0
votes
1 answer

Calculations and triggering onchange with writing result to html

I need to have #totalcost always filled. There're some javascript calculations and result is written to #total cost. I've tried to place it on JSFiddle but I had no success with triggering function onload. for each change of .number input field…
Hunkeone
  • 455
  • 4
  • 11
0
votes
1 answer

Jquery window resize flickering and wrong calculation on sticky footer

I made a simple sticky footer. It makes everything fit nicely when the page loads, but flickers and doesn't put the footer where it should go on re-size. Any ideas? $(window).on("resize", function () { $(".site-footer").css("padding-top", $(…
0
votes
3 answers

use JQuery to total cells in a row

I'm using asp.net with master pages. I have a listview that is producing 8 rows. What I would like to use jQuery to do is, when someone enters a value in cell 1-7, when they leave the cell i'd like to calculate cells 1-7 and put that value in cell…
jvcoach23
  • 2,055
  • 7
  • 31
  • 48
A