Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Mortgage caclulator utility

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 features
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Manifest
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 Version.yml
README.rdoc

mortgage_calc

www.pathf.com/blogs/2010/02/mortcalc-gem/

Calculates mortgage APR, monthly payments, and fees.

INSTALL

$ sudo gem install gemcutter
$ gem tumble
$ sudo gem install mortgage_calc

or add the following to your environment.rb

config.gem 'mortgage_calc'

Example:

loan_amount = 350000
interest_rate = 4.75
period = 30 * 12
lender_fee = 800
points = 1.0

mort_calc = MortgageCalc::MortgageUtil.new(loan_amount, interest_rate, period, lender_fee, points)

mort_calc.apr
mort_calc.monthly_payment
mort_calc.monthly_payment_with_fees
mort_calc.total_fees

Formulas used

Monthly payment with fees

P = [(C + E) r (1 + r)^N]/[(1 + r)^N - 1]

P = monthly payment
C = Loan amount
r = Interest rate
N = Period in months
E = Lender fees

Monthly payment without fees is calculated like above with E = 0.

APR

[a (1 + a)^N] / [(1 + a)^N - 1] - P/C = 0
a = A/1200
N = Period in months
P = Monthly payment
C = Loan amount

Total fees

Total fees are calculated simply by adding Lender fees to the points paid by borrower.

T = E + P(C)
Something went wrong with that request. Please try again.