Hi,
I'm trying to get the below ShowVal() case study to dispaly/return a value to 2 decimals. Where/how would I use toFixed(2) instead or Math.round?
Cheers!
I'm trying to get the below ShowVal() case study to dispaly/return a value to 2 decimals. Where/how would I use toFixed(2) instead or Math.round?
Code:
function ShowVal() {
var I=eval(document.mortgage_calculator.interest_rate.value);
var N=eval(document.mortgage_calculator.total_num_months.value);
var S=eval(document.mortgage_calculator.loan_amount.value);
Document.mortgage_calculator.monthly_pymt.value=Math.round(Monthly(I,N,S)*100)/100;
document.mortgage_calculator.total_pymts.value=Math.round(document.mortgage_calculator.monthly_pymt.value*N*100)/100;
}
Comment