var Rate = "5" / 100;
var Term = "48";
var Price = "67890";
var value = Price * (Rate/12) * (Math.pow((1 + (Rate/12)), Term))/ ((Math.pow((1 + (Rate/12)), Term)) - 1);
var value = Math.round(100*value)/100;
return value;
In here change the rate inside double quotes with the drop down’s rate and for the term, term drop-down value and for the price add the input that user type the amount.
In your text component select custom formula from the options when you click the magic text and then add the input inside the custom formula and then you can format it to the currency. Or I can add that to the JS code if you tell me which format you need!
Hi @dilon_perera ,
Thank you for your help. When you click under the car photo you will link to listing detail where there is “buy this” button, click it and will take you to how to pay. So here I need the price of a car to be default loan amount so user just enter what down payment they going to put down so the loan amount is car price minus downpayment the user entered.
The format for results I can’t follow how to do it, could you add it to the formula please,
Thanks @dilon_perera
Appreciated.
The car price is 10,000
Buyer has to deposit 2,000 so he has to enter 2,000 into downpayment input
So bank gives buyer a 8,000 loan which become the loan amount
So the formula should take 8,000 as the loan amount which comes from deducting 2,000 from 10,000 . So the formula take has the price of a car, wait user to enter amount he wants to put down and the formular take that number and deduct from the car price before it calculate monthly payment for loan of 8,000. I hope that help
var Rate = "rate from dropdown" / 100;
var Term = "term from dropdown";
var Price = "car price"-"downpayment input";
var value = Price * (Rate/12) * (Math.pow((1 + (Rate/12)), Term))/ ((Math.pow((1 + (Rate/12)), Term)) - 1);
var value = Math.round(100*value)/100;
var formatvalue = Math.trunc(value).toLocaleString();
return formatvalue;
Hi @dilon_perera,
I just implemented the new formula and it works exactly the way I wanted.
thank you so much.
Check it out and share if you want
www.motokaa.app