Vars are not adding correctly
-
I’m building a calculator for but the totals are not displaying correctly. I have formulas setup for the fields and then they are populated into an html section.
All of the calculations work correctly except for the total.
Instead of adding the two Var amounts, it’s placing them next to each other instead.Below is the code for the calculation function. The totalmins, totalhrs, etc. are the calculations that give the incorrect amount.
Is there a way to get those calculations to display correctly within the HTML?
Thanks!(function(){ var annual = (fieldname19*(fieldname13/100)), revlostweek = (annual/52), revlostweek1 = (PREC(revlostweek,2)), revlostday = (PREC(annual/365,2)), revlosthour = (PREC(annual/8760,2)), revlostmin = (PREC(annual/525600,2)), productivity = (fieldname20/100), prodlosthour1 = ((fieldname3*fieldname11)*productivity), prodlosthour2 = (PREC(prodlosthour1*1,2)), prodlostmin = (PREC(prodlosthour2/60,2)), prodlostday = (PREC(prodlosthour2*24,2)), prodlostweek = (PREC(prodlosthour2*168,2)), totalmins = (revlostmin+prodlostmin), totalhrs1 = (PREC(revlosthour+prodlosthour2,2)), totalday1 = ((revlostday)+(prodlostday)), totalweek1 = (revlostweek + prodlostweek); jQuery('.revlost_week').html(revlostweek); jQuery('.revlost_day').html(revlostday); jQuery('.revlost_hour').html(revlosthour); jQuery('.revlost_min').html(revlostmin); jQuery('.prodlost_hour').html(prodlosthour2); jQuery('.prodlost_min').html(prodlostmin); jQuery('.prodlost_day').html(prodlostday); jQuery('.prodlost_week').html(prodlostweek); jQuery('.total_mins').html(totalmins); jQuery('.total_hours').html(totalhrs1); jQuery('.total_days').html(totalday1); jQuery('.total_week').html(totalweek1); })()
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Vars are not adding correctly’ is closed to new replies.