'+ '
Choose your loan and repayment types to see the average interest rate for new home loans in ' + rateData.lastUpdated + ' (Reserve Bank of Australia). Interest rates are rising, so the average rate may now be higher.
' + '
'+ '
'+ '
'+ '
'+ '
required field
'+ '
'+CALC_NAME+' details
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
Your repayments will be:
'+ '
Total repayments
'+ '
'; // How much will my repayments be? Explore html = html + '
'+ '
'+ '
'+ '
Interest rates change by+' + formatNumber(START_BUFFER_RATE, 0, 2, true) + '%
'+ '
'+ '
New interest rate
'+ '
Your new repayments
'+ '
Your repayments will cost an extra
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'; $("#repayments").html(html); // How much can I borrow? html = '
How much can I borrow?
'+ '
'+ '
required field
'+ '
'+CALC_NAME+' details
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
You can borrow:
'+ '
Total repayments
'+ '
'; // How much can I borrow? Explore html = html + '
'+ '
'+ '
'+ '
Interest rates change by+' + formatNumber(START_BUFFER_RATE, 0, 2, true) + '%
'+ '
'+ '
New interest rate
'+ '
Your new borrowing amount
'+ '
You can borrow
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'; $("#borrow").html(html); // How can I repay my loan sooner? html = '
How can I repay my loan sooner?
'+ '
'+ '
required field
'+ '
Current '+CALC_NAME.toLowerCase()+'
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
Time to repay:
'+ '
Total repayments
'+ '
'; // How can I repay my loan sooner? Explore html = html + '
'+ '
'+ '
'+ '
Interest rates change by+' + formatNumber(START_BUFFER_RATE, 0, 2, true) + '%
'+ '
'+ '
New interest rate
'+ '
Your new repayment time
'+ '
You can repay
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'; $("#howlong").html(html); // add the frequency options to the select boxes html = '
'+ '
'+ '
'; $('#calculator-container .frequency-select').html(html); $('.tab > div').hide(); } //global vars var borrowChart; var repaymentsChart; var howlongChart; repayExplore = true; borrowExplore = true; function CalculateRepayments(lastEl){ if ( $('#repayments input:visible.empty').length > 0 && $('#repayments .result').css("display") == "none" ) { return false; } var labelCollection = []; var interestCollection = []; var principalCollection = []; //actual var rate = parseFloat( $("#repay-rate1").val().replace(/[^0-9\.]/g,'') ); //interest rate (entered p.a. so we need to convert per period) var per = parseInt( $("#repay-freq1").val() ); //number of periods (eg. 12 = 1 year) var years = parseInt( $("#repay-length1").val().replace(/[^0-9]/g,'') ); if( years < 1 ) { years=1; } if( years > 30 && CALC_NAME === 'Mortgage') { years = 30 } if( years > 15 && CALC_NAME === 'Personal loan') { years = 15; } var nper = years * per; //total number of payment periods (eg. 20 years * 12 months = 240) var pv = parseFloat( $("#repay-amount1").val().replace(/[^0-9\.]/g,'') ); //payment made each period (enter as negative) var fee = parseFloat( $("#repay-fee1").val().replace(/[^0-9\.]/g,'') ); var feeFreq = parseInt( $("#repay-feefreq1").val() ); var fv = 0; //future value var fees = parseFloat( (fee*feeFreq)/(per) ); // fee per repayment period var pmt = parseFloat( PMT((rate/100)/per, years*per, -pv, fv, 0) ) + fees; //payment made each period var result = pmt * per * years; var principal = pv; var interest = result - principal; labelCollection.push('' + CALC_NAME + ' details
Repay $'+formatNumber(pmt, 0, 0, true) + '' + freqString(per) + '
'+rate+'% for '+years+' years'); $("#repayments .inline-result span").html( '$' + formatNumber(pmt, 0, 0, true) + '' + freqString(per) ); // blank out the what if results, if amount borrowed is zero if ( pv === 0 || isNaN(pv) || isNaN(rate) ) { labelCollection[labelCollection.length-1] = ''; principal = 0; interest = 0; } interestCollection.push(interest); principalCollection.push(principal); //explore scenario var rate1Val; var per1Val; var years1Val; var amount1Val; if ( $("#repay-picker").val() == 'interestRateChange') { // keep 'What if interest rates change' synced with the loan details var bufferVal = rate + Number(document.getElementById("repay-lbl-intRate").dataset.rate); if (bufferVal < 0) { // don't let rate go negative, reset to original buffer document.getElementById("repay-lbl-intRate").dataset.rate = START_BUFFER_RATE; document.getElementById("repay-lbl-intRate").innerHTML = '+' + formatNumber(START_BUFFER_RATE, 0, 2, true) + '%'; bufferVal = rate + Number(document.getElementById("repay-lbl-intRate").dataset.rate); } rate1Val = formatNumber(bufferVal, 0, 2, true) + '%'; amount1Val = $("#repay-amount1").val(); per1Val = $("#repay-freq1").val(); years1Val = $("#repay-length1").val(); } else { rate1Val = $("#repay-rate1-explore").val(); per1Val = $("#repay-freq1-explore").val(); years1Val = $("#repay-length1-explore").val(); amount1Val = $("#repay-amount1-explore").val(); } var bufferChange = Number(document.getElementById("repay-lbl-intRate").dataset.rate); var rate1 = parseFloat(rate1Val.replace(/[^0-9\.]/g, '')); //interest rate (entered p.a. so we need to convert per period) var per1 = parseInt(per1Val); //number of periods (eg. 12 = 1 year) var years1 = parseInt(years1Val.replace(/[^0-9]/g, '')); if (years1 < 1) { years1 = 1; } if (years1 > 30 && CALC_NAME === 'Mortgage') { years1 = 30 } if (years1 > 15 && CALC_NAME === 'Personal loan') { years1 = 15; } var nper1 = years1 * per1; //total number of payment periods (eg. 20 years * 12 months = 240) var pv1 = parseFloat(amount1Val.replace(/[^0-9\.]/g, '')); //payment made each period (enter as negative) var fees1 = parseFloat((fee * feeFreq) / (per1)); // fee per repayment period if (pv1 === 0) { fees1 = 0; } var pmt1 = parseFloat(PMT((rate1 / 100) / per1, years1 * per1, -pv1, fv, 0)) + fees1; //payment made each period var result1 = pmt1 * per1 * years1; var principal1 = pv1; var interest1 = result1 - principal1; var labelHeading = 'Alternative'; if ($("#repay-picker").val() == 'interestRateChange') { labelHeading = 'If interest rate goes ' + (bufferChange < 0 ? 'down' : 'up') + ' by ' + formatNumber(bufferChange, 0, 2, true) + '%'; } else if ($("#repay-picker").val() == 'alternative') { labelHeading = 'Alternative'; } labelCollection.push('' + labelHeading + '
Repay $' + formatNumber(pmt1, 0, 0, true) + '' + freqString(per1) + '
' + rate1 + '% for ' + years1 + ' years'); var newpmt = pmt; if (per != per1) { // make frequency match for comparison newpmt = parseFloat( PMT((rate/100)/per1, years*per1, -pv, fv, 0) ) + fees; //payment made each period } var diff = newpmt - pmt1; // don't show alternative graph if no value entered or is 0 if (pv1 === 0 || isNaN(pv1) || isNaN(rate1)) { labelCollection[labelCollection.length - 1] = ''; principal1 = 10; // set to 10 so it displays on safari interest1 = 0; } interestCollection.push(interest1); principalCollection.push(principal1); var principalData = []; var interestData = []; var interestColours = ['#A6BEFC', '#e1f8fe' ]; var principalColours = ['#0146F5' ,'#210c4b' ]; for (var i=0; i < interestCollection.length; i++) { interestData.push({y:interestCollection[i], color:interestColours[i]}) } for (var i=0; i < principalCollection.length; i++) { principalData.push({y:principalCollection[i], color:principalColours[i]}) } if (bufferChange < 0) { document.getElementById("repay-lbl-resultDesc").innerHTML = 'Your repayments will reduce by'; } else { document.getElementById("repay-lbl-resultDesc").innerHTML = 'Your repayments will cost an extra'; } document.getElementById("repay-lbl-newIntRate").innerHTML = '' + formatNumber(rate1, 0, 2, true) + '%'; document.getElementById("repay-lbl-newRepayment").innerHTML = '' + '$' + formatNumber(pmt1, 0, 0, true) + ' ' + freqString(per1); document.getElementById("repay-lbl-intRateDiff").innerHTML = '' + '$' + formatNumber(diff, 0, 0, true) + ' ' + freqString(per1); //chart if ( repaymentsChart === undefined ) { //we need to create the chart on first use var html = '
'; $("#repayments .chart").html(html); repaymentsChart = new Highcharts.Chart({ chart: { renderTo: 'repayments-chart1', type: 'column', marginBottom: 90, marginTop: 30}, colors: [ '#ACE8FA', '#0047F5' ], credits: { enabled: false }, title: { text: null }, xAxis: { categories: labelCollection, labels: { y:30, style: { fontFamily: '\'Montserrat\', sans-serif', fontSize: '15px', color: '#333' } } }, yAxis: { min: 0, title: { text: null }, stackLabels: { enabled: true, style: { fontWeight: 'bold', fontFamily: '\'Montserrat\', sans-serif', fontSize: '15px', color: '#333', align: 'center', textOutline: "0px", }, formatter: function() { if (this.total > 10 || this.x == 0) { return '$' + formatNumber(this.total, 0, 0, true); } else { return 'Add comparison below'; } } }, labels: { style: { fontFamily: '\'Montserrat\', sans-serif', color: '#333' } } }, legend: { backgroundColor: '#FFFFFF', reversed: true, enabled: false }, tooltip: { formatter: function() { return this.series.name +': $' + formatNumber(this.y, 0, 0, true); } }, plotOptions: { series: { stacking: 'normal' } }, series: [{ name: 'Interest (including fees)', data: interestData }, { name: 'Principal', data: principalData }] }); } else { repaymentsChart.xAxis[0].setCategories(labelCollection); for (var i=0; i < interestCollection.length; i++) { repaymentsChart.series[0].data[i].update(interestCollection[i]); } for (var i=0; i < principalCollection.length; i++) { repaymentsChart.series[1].data[i].update(principalCollection[i]); } } $("#repayments .result").css('display', 'flex'); if ( CALC_NAME === 'Personal loan' ){ dataLayer.push({ event: 'calculatorCompleted', personalLoanData: serializeData(document.getElementById('calculator-container'), 'A', lastEl) }); } else{ dataLayer.push({ event: 'calculatorCompleted', mortgageCalcData: serializeData(document.getElementById('calculator-container'), 'A', lastEl) }); } } function CalculateBorrowAmount(lastEl){ if ( $('#borrow input:visible.empty').length > 0 && $('#borrow .result').css("display") == "none" ) { return false; } var labelCollection = []; var interestCollection = []; var principalCollection = []; var type = 0; // used for PV function //actual var rate = parseFloat( $("#rate1").val().replace(/[^0-9\.]/g,'') ); //interest rate (entered p.a. so we need to convert per period) var per = parseInt( $("#freq1").val() ); //number of periods (eg. 12 = 1 year) var years = parseInt( $("#length1").val().replace(/[^0-9]/g,'') ); if( years < 1 ) { years=1; } if( years > 30 && CALC_NAME === 'Mortgage') { years = 30 } if( years > 15 && CALC_NAME === 'Personal loan') { years = 15; } var nper = years * per; //total number of payment periods (eg. 20 years * 12 months = 240) var pmt = parseFloat( $("#payment1").val().replace(/[^0-9\.]/g,'') ); //payment made each period var fee = parseFloat( $("#fee1").val().replace(/[^0-9\.]/g,'') ); var feeFreq = parseInt( $("#feefreq1").val() ); var fv = 0; //future value var fees = (fee * feeFreq * years ); var interest = (pmt * per * years ) + fees; //interest including fees var label; //calculate actual var principal = PV((rate/100)/per, nper, -pmt+((fee*feeFreq)/per), fv, type); interest = interest - principal; if (principal <= 0) { interest = 0; principal = 0; $("#borrow .inline-result span:first").html( 'N/A' ); //label = 'Repayment won\'t cover interest and fees'; labelCollection.push('Repayment won\'t cover interest and fees'); } else { $("#borrow .inline-result span:first").html( '$' + formatNumber(principal, 0, 0, true) + '' ); //label = '' + CALC_NAME + ' details
Borrow $'+formatNumber(principal, 0, 0, true)+'
'+rate+'% for '+years+' years'; labelCollection.push('' + CALC_NAME + ' details
Borrow $'+formatNumber(principal, 0, 0, true) + '
'+rate+'% for '+years+' years'); } // blank out the what if results, if amount borrowed is zero if ( pmt === 0 || isNaN(pmt) || isNaN(rate) ) { labelCollection[labelCollection.length-1] = ''; principal = 0; interest = 0; } interestCollection.push(interest); principalCollection.push(principal); //explore scenario var rate1Val; var per1Val; var years1Val; var payment1Val; if ( $("#howmuch-picker").val() == 'interestRateChange') { // keep 'What if interest rates change' synced with the loan details var bufferVal = rate + Number(document.getElementById("howmuch-lbl-intRate").dataset.rate); if (bufferVal < 0) { // don't let rate go negative, reset to original buffer document.getElementById("howmuch-lbl-intRate").dataset.rate = START_BUFFER_RATE; document.getElementById("howmuch-lbl-intRate").innerHTML = '+' + formatNumber(START_BUFFER_RATE, 0, 2, true) + '%'; bufferVal = rate + Number(document.getElementById("howmuch-lbl-intRate").dataset.rate); } rate1Val = formatNumber(bufferVal, 0, 2, true) + '%'; payment1Val = $("#payment1").val(); per1Val = $("#freq1").val(); years1Val = $("#length1").val(); } else { rate1Val = $("#rate1-explore").val(); per1Val = $("#freq1-explore").val(); years1Val = $("#length1-explore").val(); payment1Val = $("#payment1-explore").val(); } var bufferChange = Number(document.getElementById("howmuch-lbl-intRate").dataset.rate); /* if ( borrowChart === undefined && CALC_NAME === 'Mortgage' ) { // on first calculation prefill scenario to show the buffer interest rate, all other fields copied over var bufferVal = rate + START_BUFFER_RATE; $("#rate1-explore").val(formatNumber(bufferVal, 0, 2, true) + '%'); $("#payment1-explore").val($("#payment1").val()); $("#freq1-explore").val($("#freq1").val()); $("#length1-explore").val($("#length1").val()); document.getElementById("rate1-explore").classList.remove("empty"); document.getElementById("payment1-explore").classList.remove("empty"); } */ var rate1 = parseFloat( rate1Val.replace(/[^0-9\.]/g,'') ); //interest rate (entered p.a. so we need to convert per period) var per1 = parseInt( per1Val ); //number of periods (eg. 12 = 1 year) var years1 = parseInt( years1Val.replace(/[^0-9]/g,'') ); if( years1 < 1 ) { years1=1; } if( years1 > 30 && CALC_NAME === 'Mortgage') { years1 = 30 } if( years1 > 15 && CALC_NAME === 'Personal loan') { years1 = 15; } var nper1 = years1 * per1; //total number of payment periods (eg. 20 years * 12 months = 240) var pmt1 = parseFloat( payment1Val.replace(/[^0-9\.]/g,'') ); //payment made each period var interest1 = (pmt1 * per1 * years1 ) + fees; var label1; //calculate explore scenario var principal1 = PV((rate1/100)/per1, nper1, -pmt1+((fee*feeFreq)/per1), fv, type); interest1 = interest1 - principal1; var labelHeading = 'Alternative'; if ($("#howmuch-picker").val() == 'interestRateChange') { labelHeading = 'If interest rate goes ' + (bufferChange < 0 ? 'down' : 'up') + ' by ' + formatNumber(bufferChange, 0, 2, true) + '%'; } else if ($("#howmuch-picker").val() == 'alternative') { labelHeading = 'Alternative'; } if (principal1 <= 0) { interest1 = 0; principal1 = 0; labelCollection.push('Repayment won\'t cover interest and fees '); //label1 = 'Repayment won\'t cover interest and fees'; } else { labelCollection.push('' + labelHeading + '
Borrow $' + formatNumber(principal1, 0, 0, true) + '
' + rate1 + '% for ' + years1 + ' years'); //label1 = 'Alternative
Borrow $'+formatNumber(principal1, 0, 0, true)+'
'+rate1+'% for '+years1+' years'; } var diff = principal - principal1; // don't show alternative graph if no value entered or is 0 if ( pmt1 === 0 || isNaN(pmt1) || isNaN(rate1) ) { labelCollection[labelCollection.length - 1] = ''; principal1 = 0; interest1 = 0; } interestCollection.push(interest1); principalCollection.push(principal1); var principalData = []; var interestData = []; var interestColours = ['#A6BEFC', '#e1f8fe' ]; var principalColours = ['#0146F5' ,'#210c4b' ]; for (var i=0; i < interestCollection.length; i++) { interestData.push({y:interestCollection[i], color:interestColours[i]}) } for (var i=0; i < principalCollection.length; i++) { principalData.push({y:principalCollection[i], color:principalColours[i]}) } var diffHeading = 'less'; if (bufferChange < 0) { diffHeading = 'more'; } document.getElementById("howmuch-lbl-newIntRate").innerHTML = '' + formatNumber(rate1, 0, 2, true) + '%'; document.getElementById("howmuch-lbl-newBorrowing").innerHTML = '' + '$' + formatNumber(principal1, 0, 0, true) + ''; document.getElementById("repay-lbl-borrowingDiff").innerHTML = '' + '$' + formatNumber(diff, 0, 0, true) + ' ' + diffHeading; //chart if ( borrowChart === undefined ) { //we need to create the chart on first use var html = '
'; $("#borrow .chart").html(html); borrowChart = new Highcharts.Chart({ chart: { renderTo: 'chart1', type: 'column', marginBottom: 90, marginTop: 30 }, colors: [ '#ACE8FA', '#0047F5' ], credits: { enabled: false }, title: { text: null }, xAxis: { categories: labelCollection, labels: { y:30, style: { fontFamily: '\'Montserrat\', sans-serif', fontSize: '15px', color: '#333' } } }, yAxis: { min: 0, title: { text: null }, stackLabels: { enabled: true, style: { fontWeight: 'bold', fontFamily: '\'Montserrat\', sans-serif', fontSize: '15px', color: '#333', align: 'center', textOutline: "0px", }, formatter: function() { // don't display 'Add comparison below' if they've entered an invalid comparison var invalidComparison = false; var xValue = this.x, xAxis = this.axis.chart.xAxis[0]; if(xAxis.categories[xValue] == 'Repayment won\'t cover interest and fees'){ invalidComparison = true; } if ((this.total > 10 || this.x == 0) || this.x == 1 && invalidComparison == true) { return '$' + formatNumber(this.total, 0, 0, true); } else { return 'Add comparison below'; } } }, labels: { style: { fontFamily: '\'Montserrat\', sans-serif', color: '#333' } } }, legend: { backgroundColor: '#FFFFFF', reversed: true, enabled: false }, tooltip: { formatter: function() { return this.series.name +': $' + formatNumber(this.y, 0, 0, true); } }, plotOptions: { series: { stacking: 'normal'} }, series: [{ name: 'Interest (including fees)', data: interestData }, { name: 'Principal', data: principalData }] }); } else { borrowChart.xAxis[0].setCategories(labelCollection); for (var i=0; i < interestCollection.length; i++) { borrowChart.series[0].data[i].update(interestCollection[i]); } for (var i=0; i < principalCollection.length; i++) { borrowChart.series[1].data[i].update(principalCollection[i]); } } $("#borrow .result").css('display', 'flex'); if ( CALC_NAME === 'Personal loan' ){ dataLayer.push({ event: 'calculatorCompleted', personalLoanData: serializeData(document.getElementById('calculator-container'), 'B', lastEl) }); } else{ dataLayer.push({ event: 'calculatorCompleted', mortgageCalcData: serializeData(document.getElementById('calculator-container'), 'B', lastEl) }); } } function CalculateHowlong(lastEl){ if ( $('#howlong input:visible.empty').length > 0 && $('#howlong .result').css("display") == "none" ) { return false; } var labelCollection = []; var interestCollection = []; var principalCollection = []; var type = 0; // used for NPER function //actual var rate = parseFloat( $("#howlong-rate1").val().replace(/[^0-9\.]/g,'') ); //interest rate (entered p.a. so we need to convert per period) var per = parseInt( $("#howlong-freq1").val() ); //number of periods (eg. 12 = 1 year) var pv = parseFloat( $("#howlong-amount1").val().replace(/[^0-9\.]/g,'') ); var fee = parseFloat( $("#howlong-fee1").val().replace(/[^0-9\.]/g,'') ); var feeFreq = parseInt( $("#howlong-feefreq1").val() ); var fv = 0; //future value var pmt = parseFloat( $("#howlong-payment1").val().replace(/[^0-9\.]/g,'') ); //payment made each period var nper = NPER((rate/100)/per, -pmt + ((fee*feeFreq)/per), pv, fv, type); //fee is being matched to period of repayment, this is not 100% accurate, but result should be very close var principal = pv; var totalRepayments = pmt * nper; var interest = totalRepayments - principal; var label = ''; var labelYears = nper / per; var labelMonths = Math.ceil( (labelYears % 1)* 12 ); labelYears = parseInt(labelYears); if ( labelMonths === 12 ) { labelMonths = 0; labelYears = labelYears + 1; } if ( labelYears > 0 ) { label = labelYears + (labelYears == 1 ? ' year ' : ' years '); } if ( labelMonths > 0 ) { label = label + labelMonths + (labelMonths == 1 ? ' month' : ' months'); } var totalMonths = (labelYears * 12) + labelMonths; $("#howlong .inline-result span").html( '' + label + '' ); if ( label.length < 1 ) { label = 'Repayment won\'t cover interest and fees'; interest = 0; principal = 0; $("#howlong .inline-result span").html( 'N/A' ); labelCollection.push('Repayment won\'t cover interest and fees'); } else { //label = '' + CALC_NAME + ' details
' + label + '
$'+formatNumber(pmt, 0, 0, true) + freqString(per) + ' at ' + rate+'%'; labelCollection.push('' + CALC_NAME + ' details
' + label + '
$'+formatNumber(pmt, 0, 0, true) + freqString(per) + ' at ' + rate+'%'); } // blank out the what if results, if amount borrowed is zero if ( pmt === 0 || isNaN(pmt) || isNaN(rate) || pv === 0 || isNaN(pv) ) { label = ''; principal = 0; interest = 0; $("#howlong .inline-result span").text( "" ); } interestCollection.push(interest); principalCollection.push(principal); //explore scenario var rate1Val; var per1Val; var years1Val; var payment1Val; if ( $("#howlong-picker").val() == 'interestRateChange') { // keep 'What if interest rates change' synced with the loan details var bufferVal = rate + Number(document.getElementById("howlong-lbl-intRate").dataset.rate); if (bufferVal < 0) { // don't let rate go negative, reset to original buffer document.getElementById("howlong-lbl-intRate").dataset.rate = START_BUFFER_RATE; document.getElementById("howlong-lbl-intRate").innerHTML = '+' + formatNumber(START_BUFFER_RATE, 0, 2, true) + '%'; bufferVal = rate + Number(document.getElementById("howlong-lbl-intRate").dataset.rate); } rate1Val = formatNumber(bufferVal, 0, 2, true) + '%'; payment1Val = $("#howlong-payment1").val(); per1Val = $("#howlong-freq1").val(); } else { rate1Val = $("#howlong-rate1-explore").val(); payment1Val = $("#howlong-payment1-explore").val(); per1Val = $("#howlong-freq1-explore").val(); } var bufferChange = Number(document.getElementById("howlong-lbl-intRate").dataset.rate); var rate1 = parseFloat( rate1Val.replace(/[^0-9\.]/g,'') ); //interest rate (entered p.a. so we need to convert per period) var per1 = parseInt( per1Val ); //number of periods (eg. 12 = 1 year) var pv1 = pv; // parseFloat( $("#howlong-amount1-explore").val().replace(/[^0-9\.]/g,'') ); var pmt1 = parseFloat( payment1Val.replace(/[^0-9\.]/g,'') ); //payment made each period var nper1 = NPER((rate1/100)/per1, -pmt1 + ((fee*feeFreq)/per1), pv1, fv, type); //fee is being matched to period of repayment, this is not 100% accurate, but result should be very close var principal1 = pv1; var totalRepayments1 = pmt1 * nper1; var interest1 = totalRepayments1 - principal1; var label1 = ''; var labelYears1 = nper1 / per1; var labelMonths1 = Math.ceil( (labelYears1 % 1)* 12 ); labelYears1 = parseInt(labelYears1); if ( labelMonths1 === 12 ) { labelMonths1 = 0; labelYears1 = labelYears1 + 1; } if ( labelYears1 > 0 ) { label1= labelYears1 + (labelYears1 == 1 ? ' year ' : ' years '); } if ( labelMonths1 > 0 ) { label1 = label1 + labelMonths1 + (labelMonths1 == 1 ? ' month' : ' months'); } var totalMonths1 = (labelYears1 * 12) + labelMonths1; var labelHeading = 'Alternative'; if ($("#howlong-picker").val() == 'interestRateChange') { labelHeading = 'If interest rate goes ' + (bufferChange < 0 ? 'down' : 'up') + ' by ' + formatNumber(bufferChange, 0, 2, true) + '%'; } else if ($("#howlong-picker").val() == 'alternative') { labelHeading = 'Alternative'; } if ( label1.length < 1 ) { //label1 = 'Repayment won\'t cover interest and fees'; interest1 = 0; principal1 = 0; labelCollection.push('Repayment won\'t cover interest and fees'); } else{ //label1 = 'Alternative
' + label1 + '
$'+formatNumber(pmt1, 0, 0, true) + freqString(per1) + ' at ' + rate1+'%'; labelCollection.push('' + labelHeading + '
' + label1 + '
$'+formatNumber(pmt1, 0, 0, true) + freqString(per1) + ' at ' + rate1+'%'); } var diff = ''; if (bufferChange < 0) { diff = (totalMonths - totalMonths1); } else { diff = totalMonths1 - totalMonths; } diff = diff + (Number(diff) == 1 ? ' month' : ' months'); // blank out the what if results, if hidden, or no what if repayment supplied if ( pmt1 === 0 || isNaN(pmt1) ) { label1 = ''; principal1 = 0; interest1 = 0; labelCollection[labelCollection.length - 1] = ''; } interestCollection.push(interest1); principalCollection.push(principal1); var principalData = []; var interestData = []; var interestColours = ['#A6BEFC', '#e1f8fe' ]; var principalColours = ['#0146F5' ,'#210c4b' ]; for (var i=0; i < interestCollection.length; i++) { interestData.push({y:interestCollection[i], color:interestColours[i]}) } for (var i=0; i < principalCollection.length; i++) { principalData.push({y:principalCollection[i], color:principalColours[i]}) } var diffHeading = 'later'; if (bufferChange < 0) { diffHeading = 'sooner'; } document.getElementById("howlong-lbl-newIntRate").innerHTML = '' + formatNumber(rate1, 0, 2, true) + '%'; document.getElementById("howlong-lbl-newTime").innerHTML = '' + (label1.length < 1 ? 'N/A' : label1) + ' '; document.getElementById("howlong-lbl-timeDiff").innerHTML = '' + (label1.length < 1 ? 'N/A' : diff) + ' ' + (label1.length < 1 ? '' : diffHeading); //chart if ( howlongChart === undefined ) { //we need to create the chart on first use var html = '
'; $("#howlong .chart").html(html); howlongChart = new Highcharts.Chart({ chart: { renderTo: 'howlong-chart1', type: 'column', marginBottom: 90, marginTop: 30 }, colors: [ '#ACE8FA', '#0047F5' ], credits: { enabled: false }, title: { text: null }, xAxis: { categories: labelCollection, labels: { y:30, style: { fontFamily: '\'Montserrat\', sans-serif', fontSize: '15px', color: '#333' } } }, yAxis: { min: 0, title: { text: null }, stackLabels: { enabled: true, style: { fontWeight: 'bold', fontFamily: '\'Montserrat\', sans-serif', fontSize: '15px', color: '#333', align: 'center', textOutline: "0px", }, formatter: function() { // don't display 'Add comparison below' if they've entered an invalid comparison var invalidComparison = false; var xValue = this.x, xAxis = this.axis.chart.xAxis[0]; if(xAxis.categories[xValue] == 'Repayment won\'t cover interest and fees'){ invalidComparison = true; } if ((this.total > 10 || this.x == 0) || this.x == 1 && invalidComparison == true) { return '$' + formatNumber(this.total, 0, 0, true); } else { return 'Add comparison below'; } } }, labels: { style: { fontFamily: '\'Montserrat\', sans-serif', color: '#333' } } }, legend: { backgroundColor: '#FFFFFF', reversed: true, enabled: false }, tooltip: { formatter: function() { return this.series.name +': $' + formatNumber(this.y, 0, 0, true); } }, plotOptions: { series: { stacking: 'normal'} }, series: [{ name: 'Interest (including fees)', data: interestData }, { name: 'Principal', data: principalData }] }); } else { howlongChart.xAxis[0].setCategories(labelCollection); howlongChart.series[0].data[0].update(interest); howlongChart.series[1].data[0].update(principal); howlongChart.series[0].data[1].update(interest1); howlongChart.series[1].data[1].update(principal1); } $("#howlong .result").css('display', 'flex'); if ( CALC_NAME === 'Personal loan' ){ dataLayer.push({ event: 'calculatorCompleted', personalLoanData: serializeData(document.getElementById('calculator-container'), 'C', lastEl) }); } else{ dataLayer.push({ event: 'calculatorCompleted', mortgageCalcData: serializeData(document.getElementById('calculator-container'), 'C', lastEl) }); } } function freqString(s){ if ( s === 1 ) { s = 'year'; } if ( s === 4 ) { s = 'quarter'; } if ( s === 12 ) { s = 'month'; } if ( s === 26 ) { s = 'fortnight'; } if ( s === 52 ) { s = 'week'; } return '\xa0per\xa0' + s; } /* CALCULATOR FORMULAS */ // NPER - returns the number of periods for an investment based on an interest rate and a constant payment schedule function NPER(rate, pmt, pv, fv, type) { if (type === undefined) { type = 0; } var num = pmt * (1 + rate * type) - fv * rate; var den = (pv * rate + pmt * (1 + rate * type)); if ( rate === 0 ) { return -(fv + pv)/pmt; } else { return Math.log(num / den) / Math.log(1 + rate); } } // PMT - returns the payment amount for a loan based on an interested rate and a constant payment schedule function PMT(rate, nper, pv, fv, type) { var result; if (rate === 0) { result = (pv + fv) / nper; } else { var term = Math.pow(1 + rate, nper); if (type === 1) { result = (fv * rate / (term - 1) + pv * rate / (1 - 1 / term)) / (1 + rate); } else { result = fv * rate / (term - 1) + pv * rate / (1 - 1 / term); } } return -result; } // PV - returns the present value of an investent based on an interest rate and a constant payment schedule function PV(rate, nper, pmt, fv, type) { if (type === undefined) { type = 0; } if (rate === 0) { return - pmt * nper - fv; } else { return (((1 - Math.pow(1 + rate, nper)) / rate) * pmt * (1 +rate * type) - fv) / Math.pow(1 + rate, nper); } } function formatNumber(number, digits, decimalPlaces, withCommas) { number = number.toString(); var simpleNumber = ''; // Strips out the dollar sign and commas. for (var i = 0; i < number.length; ++i) { if ("0123456789.".indexOf(number.charAt(i)) >= 0) simpleNumber += number.charAt(i); } number = parseFloat(simpleNumber); if (isNaN(number)) number = 0; if (withCommas === null) withCommas = false; if (digits === 0) digits = 1; var integerPart = (decimalPlaces > 0 ? Math.floor(number) : Math.round(number)); var string = ""; for (var i = 0; i < digits || integerPart > 0; ++i) { // Insert a comma every three digits. if (withCommas && string.match(/^\d\d\d/)) string = "," + string; string = (integerPart % 10) + string; integerPart = Math.floor(integerPart / 10); } if (decimalPlaces > 0) { number -= Math.floor(number); number *= Math.pow(10, decimalPlaces); string += "." + formatNumber(number, decimalPlaces, 0); } return string; } function serializeData(container, calcType, lastEl){ var version = "v2"; changeCount++; var data=''; var inputs=container.querySelectorAll('input,select'); var lastElID = lastEl.id; var loopCnt = 0; var lastChanged = ''; inputs.forEach(function(input) { loopCnt++; var inputVal = input.value; if (input.classList.contains('dollars')) { inputVal = inputVal.replace(/\D+/g, ''); } inputVal = inputVal.replace('%', ''); inputVal = inputVal.replace(' years', ''); data += inputVal + '|'; if (lastElID === input.id) { lastChanged = loopCnt.toString(); } }); data += changeCount.toString() + "|" + calcType + "|" + version + "|" + lastChanged; return data; }
Weigh up the pros and cons of fixed and variable interest rates to decide which suits you.
Fixed interest rate
A fixed interest rate stays the same for a set period (for example, five years). The rate then goes to a variable interest rate, or you can negotiate another fixed rate.
Pros:
- Makes budgeting easier as you know what your repayments will be.
- Fewer loan features could cost you less.
Cons:
- You won't get the benefit if interest rates go down.
- It may cost more to switch loans later, if you're charged a break fee.
Variable interest rate
A variable interest rate can go up or down as the lending market changes (for example when official cash rates change).
Pros:
- More loan features may offer you greater flexibility.
- It's usually easier to switch loans later, if you find a better deal.
Cons:
- Makes budgeting harder as your repayments could go up or down.
- More loan features could cost you more.
Partially-fixed rate
If you're not sure whether a fixed or variable interest rate is right for you, consider a bit of both. With a partially-fixed rate (split loan), a portion of your loan has a fixed rate and the rest has a variable rate. You can decide how to split the loan (for example, 50/50 or 20/80).
Mortgage features come at a cost
Home loans with more options or features can come at a higher cost. These could include an offset account, redraw or line of credit facilities. Most are ways of putting extra money into your loan to reduce the amount of interest you pay.
Weigh up if features are worth it
For example, suppose you are considering a $500,000 loan with an offset account. If you're able to keep $20,000 of savings in the offset, you'll pay interest on $480,000. But if your offset balance will always be low (for example under $10,000), it may not be worth paying for this feature.
Avoid paying more for 'nice-to-have' options
When comparing loans, consider your lifestyle and what options you really need. What features are 'must-haves'? What are 'nice-to-haves'? Is it worth paying extra for features you may never use? You may be better off choosing a basic loan with limited features.
Work out what you can afford to borrow
Be realistic about what you can afford. Mortgage interest rates are on the rise, so give yourself some breathing room.
Use the mortgage calculator
Work out your home loan repayments and compare different rates.
Compare home loans
With the amount you can afford to borrow, compare loans from at least two different lenders. Check the loan interest rates, fees and features to get the best loan for you.
Comparison websites can be useful, but they are businesses and may make money through promoted links. They may not cover all your options. See what to keep in mind when using comparison websites.
Compare these features:
Interest rate (per year) |
|
Comparison rate (per year) |
|
Monthly repayment |
|
Application fee |
|
Ongoing fees |
|
Loan term |
|
Loan features |
|
Using a mortgage broker
With many lenders to choose from, you may decide to get a mortgage broker to find loan options for you. See using a mortgage broker for tips on what to ask your lender or broker.
Mai and Michael get the best deal on a home loan
Mai and Michael are looking to buy a $600,000 apartment. They've saved a 20% deposit and want to borrow $480,000 over 25 years.
They check a comparison website to compare:
- interest rates — variable versus fixed
- fees — application fee, ongoing fees
- features — basic versus extra (redraw facility, additional repayments)
Ticking different boxes on the website, they look at loan options to see how the cost varies. They decide they want to be able to make additional repayments. Using this as a filter, they review loan options.
They repeat the process with another comparison website.
Then, using the mortgage calculator, they compare the impact of different interest rates over 25 years.
Based on their research, they shortlist loans from two lenders. They approach each lender to get a written quote personalised for their situation, then choose the best loan.