pub fn monthly_contribution(&self) -> f64 {
        let num = match self.period {
            Period::Every1Month => self.amount,
            Period::Every2Months => self.amount / 2.0,
            Period::Every3Months => self.amount / 3.0,
            Period::Every6Months => self.amount / 6.0,
            Period::Every12Months => self.amount / 12.0,
        };

        match self.item_type {
            Type::Income => num,
            Type::Expense => -num,
        }
    }
/// Calculate the monthly contributions for this item.
///
/// # Returns
/// The monthly contribution, calculated based on the entry's amount and its period.
Calculate the monthly contributions for this item.
Calculate the monthly contributions for this item .
pub fn monthly_contribution(&self) -> f64 {
        let num = match self.period {
            Period::Every1Month => self.amount,
            Period::Every2Months => self.amount / 2.0,
            Period::Every3Months => self.amount / 3.0,
            Period::Every6Months => self.amount / 6.0,
            Period::Every12Months => self.amount / 12.0,
        };
        match self.item_type {
            Type::Income => num,
            Type::Expense => -num,
        }
    }
pub fn monthly_contribution ( & self ) -> f64 { let num = match self . period { Period :: Every1Month => self . amount , Period :: Every2Months => self . amount / 2.0 , Period :: Every3Months => self . amount / 3.0 , Period :: Every6Months => self . amount / 6.0 , Period :: Every12Months => self . amount / 12.0 , } ; match self . item_type { Type :: Income => num , Type :: Expense => - num , } }
Calculate the monthly contributions for this item.
Calculate the monthly contributions for this item .
&self
The monthly contribution, calculated based on the entry's amount and its period.
The monthly contribution calculated based on the entry ' s amount and its period .
&self