Skip to content

Instantly share code, notes, and snippets.

@ghalimi
Last active December 11, 2015 10:58
Show Gist options
  • Save ghalimi/4590502 to your computer and use it in GitHub Desktop.
Save ghalimi/4590502 to your computer and use it in GitHub Desktop.
FVSCHEDULE Function
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function FVSCHEDULE(principal, schedule) {
// Initialize future value
var future = principal;
// Apply all interests in schedule
for (var i = 0; i < schedule.length; i++) {
// Return error if schedule value is not a number
if (isNaN(schedule[i])) return '#VALUE!';
// Apply scheduled interest
future *= 1 + schedule[i];
}
// Return future value
return future;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment