October 26th, 2013, 01:45 AM
I am developing a form that will allow the user to test various financial scenarios to arrive at the most favorable terms for leasing a car. I am having trouble with making a precise (two decimal places) calculation.
Specifically, the scenario/question can be summarized like this:
1. A person has only a single total of $500 available to apply towards both a down payment and the 10% tax on the down payment.
2. The same $500 has to cover not only a down payment but also the tax (of 10%) on what ever amount of the $500 is then remaining for the down payment. (some car leases require the lessor to pay tax on the down payment).
Help would be gratefully appreciated!
October 26th, 2013, 02:38 AM
the gist of it is something like this:
var total = 500;
var tax = 10;
var x; //what you want to find
x = total / (1 + (tax/100)); // x + (tax/100)*x = total
var taxAmtTotal = (tax/100)*x;
In this case, x = 454.55 (rounded) and the taxAmtTotal = 45.45 for a total of 500.00
Last edited by DonR; October 26th, 2013 at 02:48 AM.
October 26th, 2013, 11:59 AM
Thanks DonR, your answer is perfect, exactly what I was looking for.
I really appreciate the help!