The calcn function calculates the number of payments, as follows:

->a

The number of payments per year (stopyr) must be set before any time value of money calculations can be done. The default is monthly payments. Four out of five of the following must be set before calculating the fifth value: future value (stofv), annual interest rate (stoi%yr), number of payments (ston), payment value (stopmt), and present value (stopv).