eva21 Posted December 2, 2008 Share Posted December 2, 2008 Im having a hard time getting it to do the right calculations. Here is my javascript code: //Checks to see if all the values have been inputted total = cost2 + travelCost2; cents = salary2/1920 * 76.5; dec = accCost2 * nightsAcc2; total2 = total + cents + dec; //total2 = total2.toFixed(2); //put it back into the total document.getElementById("totalCost").value = "$" + total2; Except in the total box, it gives me total, cents, and dec into a string like for example Total | 10.000.420 Why is it doing that instead of adding the three things together? Quote Link to comment Share on other sites More sharing options...
eva21 Posted December 2, 2008 Author Share Posted December 2, 2008 Firgured it out Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.