Skip to content

Instantly share code, notes, and snippets.

@ghalimi
Created January 22, 2013 19:23
Show Gist options
  • Save ghalimi/4597516 to your computer and use it in GitHub Desktop.
Save ghalimi/4597516 to your computer and use it in GitHub Desktop.
ISPMT Function
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function ISPMT(rate, period, periods, value) {
// Evaluate rate and periods (TODO: replace with secure expression evaluator)
rate = eval(rate);
periods = eval(periods);
// Return interest
return value * rate * (period / periods - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment