Skip to content

Instantly share code, notes, and snippets.

@catb0t
Created September 21, 2016 11:40
Show Gist options
  • Save catb0t/8ddb0efd992e7635d7bbe05b59f42d17 to your computer and use it in GitHub Desktop.
Save catb0t/8ddb0efd992e7635d7bbe05b59f42d17 to your computer and use it in GitHub Desktop.
carloan
double monthlyRate = interestRate / 12f;
double finalPrice = (
carPrice * (
monthlyRate * (
Math.pow( (1f + monthlyRate), loanLength)
) / (
Math.pow( (1f + monthlyRate), loanLength) - 1f))); //Car loan forumla.
finalPrice = Math.floor(finalPrice); //Flooring to make it look nice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment