cfpb / amortize

A node module to calculate the interest paid, principal paid, remaining balance, and monthly payment of a loan.
Creative Commons Zero v1.0 Universal
58 stars 19 forks source link

Allow amortize params to be zero #5

Closed contolini closed 10 years ago

contolini commented 10 years ago

@ascott1 Currently, the loan amount and interest rate params have to be positive numbers. Passing 0 or below throws an error.

Someone could borrow money with a zero percent interest rate. This PR tells the module to only reject negative values. It will help when amortizing on the fly from user input.

ascott1 commented 10 years ago

Lookin' good to me. Nice catch.