I am having trouble with my toFixed() method. Before I added it onto all the parseFloats, which were already there, it was displaying all the totals but with too many decimal places. Now it displays nothing. When I take the toFixed() off, it displays like it should. Console is telling me "total.tofixed" is not a function, but this part was working before I added in the other 6 toFixed() commands. Here is my code
var rent = prompt ("Enter your total rent");
var food = prompt ("Enter your total food expenditures");
var utilities = prompt ("Enter your total utilities costs");
var transport = prompt ("Enter your total transportations costs");
var internet = prompt ("Enter your internet and cable costs");
var other = prompt ("Enter an estimated total for all other expenditures");
rent = parseFloat(rent).toFixed(2);
food = parseFloat(food).toFixed(2);
utilities = parseFloat(utilities).toFixed(2);
transport = parseFloat(transport).toFixed(2);
internet = parseFloat(internet).toFixed(2);
other = parseFloat(other).toFixed(2);
var total = rent + food + utilities + transport + other;
total = total.toFixed(2); //determines "total" variable will use 2 decimal places
document.write(total);
var rentPerc = (rent / total)*100;
var foodPerc = (food / total)*100;
var utPerc = (utilities / total)*100;
var transPerc = (transport / total)*100;
var internetPerc = (internet / total)*100;
var otherPerc = (other / total)*100;
var totalPerc = rentPerc + foodPerc + utPerc + transPerc + internetPerc +otherPerc;
document.write("Total rent:", rent, rentPerc, "Total food", food, foodPerc, "Total utilities:",
utilities, utPerc, "Total transportation:", transport, transPerc, "Total internet:", internet,
internetPerc, "Total other:", other, otherPerc, "Total expenditures:", total, totalPerc);