Skip to contents

Rounds up to whole months and returns 0 when the target is already met. From the Emergency fund chapter.

Usage

months_to_ef_goal(target, current_balance, monthly_contribution)

Arguments

target

Target balance.

current_balance

Amount already saved.

monthly_contribution

Amount added each month. Must be greater than 0.

Value

A numeric vector of whole months.

Examples

# $9,600 target, $1,200 saved, $400/month contribution
months_to_ef_goal(target = 9600, current_balance = 1200, monthly_contribution = 400)
#> [1] 21