Skip to content

Instantly share code, notes, and snippets.

@MattBevis
Created November 13, 2020 11:11
Show Gist options
  • Save MattBevis/855606693cbea3d33c8243518e8eb808 to your computer and use it in GitHub Desktop.
Save MattBevis/855606693cbea3d33c8243518e8eb808 to your computer and use it in GitHub Desktop.
const p = 250000 - (20 / 100) * 250000;
console.log('calcMonthlyRepayment -> p', p);
// monthly intrest
let i = (5 / 100 / 12).toFixed(6);
console.log('calcMonthlyRepayment -> i', i);
// number of periods (months)
let n = 30 * 12;
console.log('calcMonthlyRepayment -> n', n);
var ab = 1 + 0.004167;
let m = (p * (i * ab ** n)) / (4.468278 - 1);
console.log('calcMonthlyRepayment -> m', m);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment