Skip to content

Last balance value of due_fixed_payment_amortization method always 0.0 #3

@lesterz

Description

@lesterz

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}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions