budget.js
// calculates the overall budget and updates it

calculates the overall budget and updates it
calculates the overall budget and updates it
function calculateBudget() {
           let sum = 0.0;
           for(let i = 0; i < sum_incomes.length; i++)
               sum += parseFloat(sum_incomes[i]);
           for(let i = 0; i < sum_expenses.length; i++)
               sum -= parseFloat(sum_expenses[i]);
           let removeBudget = document.getElementById('budgetSum');
           let parentElement = removeBudget.parentElement;
           parentElement.removeChild(removeBudget);
           sum = Math.round((sum + Number.EPSILON) * 100) / 100;
           document.getElementById("bigTitle").innerHTML = `
           <h1 id="budgetSum">Available budget :`+String(sum)+`</h1>
                   `
       }
function calculateBudget ( ) { let sum = 0.0 ; for ( let i = 0 ; i < sum_incomes . length ; i ++ ) sum += parseFloat ( sum_incomes [ i ] ) ; for ( let i = 0 ; i < sum_expenses . length ; i ++ ) sum -= parseFloat ( sum_expenses [ i ] ) ; let removeBudget = document . getElementById ( 'budgetSum' ) ; let parentElement = removeBudget . parentElement ; parentElement . removeChild ( removeBudget ) ; sum = Math . round ( ( sum + Number . EPSILON ) * 100 ) / 100 ; document . getElementById ( "bigTitle" ) . innerHTML = ` ` + String ( sum ) + ` ` }
calculates the overall budget and updates it
calculates the overall budget and updates it