Skip to content

Instantly share code, notes, and snippets.

@jstoppa
Last active May 27, 2019 00:18
Show Gist options
  • Save jstoppa/c90e16ac11d265ea9890fdfaad8a03a6 to your computer and use it in GitHub Desktop.
Save jstoppa/c90e16ac11d265ea9890fdfaad8a03a6 to your computer and use it in GitHub Desktop.
// Monthly Payment - schema = contact.mortgageMonthlyPayments
contact.mortgageAmount * (contact.mortgageInterestRate/100/12) *
(Math.pow(1 + (contact.mortgageInterestRate/100/12), (contact.mortgagePeriod*12)))
/
(Math.pow(1 + (contact.mortgageInterestRate/100/12), (contact.mortgagePeriod*12)) - 1)
// Total cost of mortgage - schema = contact.mortgageTotalCost
contact.mortgagePeriod * 12 * contact.mortgageMonthlyPayments
// Total payments - schema = contact.mortgageTotalPayments
contact.mortgageTotalCost - contact.mortgageAmount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment