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.…
Fabrizio Cocco
- 171
- 10
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();
…
Radoslav Trenev
- 345
- 1
- 6
- 17
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…
Bert Slater
- 1
- 1
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
0
votes
3 answers
Two dimensional array help output a valueI 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…
Barry Corrigan
0
votes
3 answers
Calculate From To Time Difference - Total Work TimeI 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
0
votes
1 answer
Subtract from parent rowsI'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:
|