pub struct NpvPeriod { /* private fields */ }
Implementations§
Source§impl NpvPeriod
impl NpvPeriod
pub fn new( period: u32, rate: f64, present_value: f64, future_value: f64, investment_value: f64, formula: String, formula_symbolic: String, ) -> Self
Sourcepub fn period(&self) -> u32
pub fn period(&self) -> u32
Returns the period number. The first real period is 1 but there’s also a period 0 which which shows the starting conditions.
Sourcepub fn rate(&self) -> f64
pub fn rate(&self) -> f64
Returns the periodic rate for the current period. If the containing struct is a
TvmSolution
every period will have the same rate. If it’s a [TvmSchedule
] each period
may have a different rate.
Sourcepub fn present_value(&self) -> f64
pub fn present_value(&self) -> f64
Returns the present value of the cashflow.
Sourcepub fn future_value(&self) -> f64
pub fn future_value(&self) -> f64
Returns the future value of the cashflow.
Sourcepub fn investment_value(&self) -> f64
pub fn investment_value(&self) -> f64
Returns the investment value of the Npv scenario at the time of the current period.
Sourcepub fn formula(&self) -> &str
pub fn formula(&self) -> &str
Returns a text version of the formula used to calculate the value for the current period.
The formula includes the actual values rather than variable names. For the formula with
variables such as pv for present value call formula_symbolic
.
Sourcepub fn formula_symbolic(&self) -> &str
pub fn formula_symbolic(&self) -> &str
Returns a text version of the formula used to calculate the value for the current period.
The formula includes variables such as r for the rate. For the formula with actual values
rather than variables call formula
.