I'm trying to add some funds and I want to use Double.parseDouble but, I don't think the page is recognizing double.parseDouble. I don't get an error but it won't add or pass the values.
Here is my code.
function CalculateBudget(){
var table = document.getElementById('tblBudgetTotals');
input1600 = 0;
input1602 = 0;
input1603 = 0;
input1608 = 0;
input1612 = 0;
funding = 0;
budgetSum = 0;
input1600 = Double.parseDouble(document.getElementById('txt1600').value);
input1602 = Double.parseDouble(document.getElementById('txt1602').value);
input1603 = Double.parseDouble(document.getElementById('txt1603').value);
input1608 = Double.parseDouble(document.getElementById('txt1608').value);
input1612 = Double.parseDouble(document.getElementById('txt1612').value);
funding = Double.parseDouble(document.getElementById('FundingTotals').value);
budgetSum += Double.parseDouble(input1600) + Double.parseDouble(input1602) + Double.parseDouble(input1603) + Double.parseDouble(input1608) + Double.parseDouble(input1612) + Double.parseDouble(funding);
document.getElementById('totbud').value = Double.parseDouble(budgetSum);
}
I think you should just be using parseFloat
for this, since according to these threads all numbers in JavaScript are already "double precision" (64-bit) floats.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With