[−][src]Struct finance_solution::PaymentSolution
Implementations
impl PaymentSolution
[src]
pub fn print_table(&self)
[src]
pub fn series(&self) -> PaymentSeries
[src]
Calculates the period-by-period details of a payment calculation including how the payment is broken down between principal and interest.
Examples
An amortized loan. Uses [payment
].
use finance_solution::*; let years = 5; // The annual percentage rate is 15% and the interest will compound monthly. let rate = convert_apr_to_epr(0.15, 12); // Each period will be one month. let periods = years * 12; // The amount of the loan is $20,000. let present_value = 20_000; // The loan will be fully paid off ot the end of the last period. let future_value = 0; // Payments are due at the end of the month. let due_at_beginning = false; // Calculate the payment, creating a struct that contains additional information and the option // to generate period-by-period details. let solution = payment_solution(rate, periods, present_value, future_value, due_at_beginning); dbg!(&solution); // Calculate the month-by-month details including the principal and interest paid every month. let series = solution.series(); dbg!(&series); // Confirm that we have one entry for each period. assert_eq!(periods as usize, series.len()); // Print the period detail numbers as a formatted table. let include_running_totals = true; let include_remaining_amounts = true; let locale = num_format::Locale::en; let precision = 2; // Two decimal places. series.print_table_locale(include_running_totals, include_remaining_amounts, &locale, precision); // As above but print only the last period for every yeor of the loan, that is periods 12, 24, // 36, 48, and 60; and use default formatting. series .filter(|x| x.period() % 12 == 0) .print_table(include_running_totals, include_remaining_amounts);
pub fn print_ab_comparison(
&self,
other: &PaymentSolution,
include_running_totals: bool,
include_remaining_amounts: bool
)
[src]
&self,
other: &PaymentSolution,
include_running_totals: bool,
include_remaining_amounts: bool
)
pub fn print_ab_comparison_locale(
&self,
other: &PaymentSolution,
include_running_totals: bool,
include_remaining_amounts: bool,
locale: &Locale,
precision: usize
)
[src]
&self,
other: &PaymentSolution,
include_running_totals: bool,
include_remaining_amounts: bool,
locale: &Locale,
precision: usize
)
Methods from Deref<Target = CashflowSolution>
pub fn calculated_field(&self) -> &CashflowVariable
[src]
pub fn rate(&self) -> f64
[src]
pub fn periods(&self) -> u32
[src]
pub fn present_value(&self) -> f64
[src]
pub fn future_value(&self) -> f64
[src]
pub fn due_at_beginning(&self) -> bool
[src]
pub fn payment(&self) -> f64
[src]
pub fn sum_of_payments(&self) -> f64
[src]
pub fn sum_of_interest(&self) -> f64
[src]
pub fn formula(&self) -> &str
[src]
pub fn symbolic_formula(&self) -> &str
[src]
Trait Implementations
impl Clone for PaymentSolution
[src]
fn clone(&self) -> PaymentSolution
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PaymentSolution
[src]
impl Deref for PaymentSolution
[src]
type Target = CashflowSolution
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Auto Trait Implementations
impl RefUnwindSafe for PaymentSolution
impl Send for PaymentSolution
impl Sync for PaymentSolution
impl Unpin for PaymentSolution
impl UnwindSafe for PaymentSolution
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,