Struct ConvertRateSolution

Source
pub struct ConvertRateSolution { /* private fields */ }

Implementations§

Source§

impl ConvertRateSolution

Source

pub fn new( input_name: ConvertRateVariable, input_rate: f64, compounds_per_year: u32, apr_in_percent: String, epr_in_percent: String, ear_in_percent: String, apr: f64, epr: f64, ear: f64, apr_formula: &str, epr_formula: &str, ear_formula: &str, ) -> Self

Source

pub fn input_rate(&self) -> f64

Returns the input rate.

Source

pub fn apr(&self) -> f64

Returns the annual rate (apr).

Source

pub fn epr(&self) -> f64

Returns the periodic rate (epr).

Source

pub fn ear(&self) -> f64

Returns the effective annual rate (ear).

Source

pub fn input_name(&self) -> &ConvertRateVariable

Returns the input name (Ear, Apr, Epr, AprContinuous…etc).

Source

pub fn compounds_per_year(&self) -> u32

Returns the compounds per year as u32.

Source

pub fn apr_in_percent(&self) -> &String

Returns the annual rate (APR) in percentage format (for example, 3.58%).

Source

pub fn ear_in_percent(&self) -> &String

Returns the effective annual rate (EAR) in percentage format (for example, 3.69%).

Source

pub fn epr_in_percent(&self) -> &String

Returns the periodic rate (EPR) in percentage format (for example, 1.12%).

Trait Implementations§

Source§

impl Debug for ConvertRateSolution

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.