Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last balance value of due_fixed_payment_amortization method always 0.0 #3

Open
lesterz opened this issue Dec 11, 2015 · 0 comments
Open

Comments

@lesterz
Copy link

lesterz commented Dec 11, 2015

Firstly, thanks for writing this library, it's very helpful. I'm using due_fixed_payment_amortization to calculate remaining balance after 10 years paid monthly. In the returned json, the final balance is always 0.0 so you must add an extra payment, ie. 121 payments then pull the balance from 120. It would be better to just pass in the exact number of payments instead of always adding 1. This is not the case with other methods.

due_fixed_payment_amortization(121, 315500, 0.001666, 1051)
[{:period=>0, :monthly_payment=>nil, :interest=>nil, :payment=>nil, :balance=>315500.0}, {:period=>1, :payment=>1051.6666666666667, :interest=>525.8333333333334, :monthly_payment=>525.8333333333334, :balance=>314974.1666666667}, {:period=>2, :payment=>1051.6666666666667, :interest=>524.9569444444445, :monthly_payment=>526.7097222222222, :balance=>314447.45694444445}, ......
...
...
{:period=>120, :payment=>1051.6666666666667, :interest=>410.5877625341851, :monthly_payment=>641.0789041324816, :balance=>245711.57861637857}, {:period=>121, :payment=>1051.6666666666667, :interest=>409.5192976939643, :monthly_payment=>642.1473689727025, :balance=>0.0}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant