Skip to contents

Interest compounds monthly at apr / 12. The result is not rounded; the last payment is a partial one. Errors when the payment does not cover the first month's interest, because the balance would never be paid off. From the Managing debt chapter.

Usage

months_to_payoff(balance, monthly_payment, apr)

Arguments

balance

Current balance. Must be greater than 0.

monthly_payment

Fixed monthly payment. Must be greater than 0.

apr

Annual percentage rate, as a decimal.

Value

A numeric vector of months.

Examples

# $5,000 balance, $100/month, 22% APR
months_to_payoff(balance = 5000, monthly_payment = 100, apr = 0.22)
#> [1] 136.7791