Servee is moving into real estate territory, more details to come, but I've made this simple mortgage calculator. Free to use, no warranty, etc.
Here is the code for your copy and paste, check the example below. It requires Jquery to function. My styles also may mess up the line breaks in the HTML, but the JS is all pretty short, so it's not a big deal.
<!-- if you don't have jquery -->
<script type='text/javascript' src='http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js'></script><!--The following formula is used to calculate the fixed monthly payment (P) required to fully amortize a loan of L dollars over a term of n months at a monthly interest rate of c. [If the quoted rate is 6%, for example, c is .06/12 or .005].
P = L[c(1 + c)^n]/[(1 + c)^n - 1]-->
<h3>Mortgage Calculator</h3>
<form >
<p> <input type="text" name="mcPrice" id="mcPrice" class="mortgageField" />
Sale price ($)
</p>
<p> <input type="text" name="mcDown" id="mcDown" class="mortgageField" />
Down payment (%)</p>
<p> <input type="text" name="mcRate" id="mcRate" class="mortgageField" />
Interest Rate (%)</p>
<p> <input type="text" name="mcTerm" id="mcTerm" class="mortgageField" />
Term (years)</p>
<button class="smallButton" id="mortgageCalc" onclick="return false">Calculate Monthly Payment</button>
<input type="text" name="mcPayment" id="mcPayment" class="mortgageAnswer" />
</form>
<script type="text/javascript">
$("#mortgageCalc").click(function(){
var L,P,n,c,dp;
L = parseInt($("#mcPrice").val());
n = parseInt($("#mcTerm").val()) * 12;
c = parseFloat($("#mcRate").val())/1200;
dp = 1 - parseFloat($("#mcDown").val())/100;
L = L * dp;
P = (L*(c*Math.pow(1+c,n)))/(Math.pow(1+c,n)-1);
if(!isNaN(P))
{
$("#mcPayment").val(P.toFixed(2));
}
else
{
$("#mcPayment").val('There was an error');
}
return false;
});
</script>
11th January 2009
I won't ever give out your email address. I don't publish comments but if you'd like to write to me then you could use this form.
I'm Issac. I live in Oakland. I make things for fun and money. I use electronics and computers and software. I manage teams and projects top to bottom. I've worked as a consultant, software engineer, hardware designer, artist, technology director and team lead. I do occasional fabrication in wood and plastic and metal. I run a boutique interactive agency with my brother Kasey and a roving cast of experts at Kelly Creative Tech. I was the Director of Technology for Nonchalance during the The Latitude Society project. I was the Lead Web Developer and then Technical Marketing Engineer at Nebula, which made an OpenStack Appliance. I've been building things on the web and in person since leaving Ohio State University's Electrical and Computer engineering program in 2007. Lots of other really dorky things happened to me before that, like dropping out of high school to go to university, getting an Eagle Scout award, and getting 6th in a state-wide algebra competition. I have an affinity for hopscotch.