Skip to content

Commit d29ce8c

Browse files
committed
fixed typos + removed 'return' keyword
1 parent d115f16 commit d29ce8c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/financial/compound_interest.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// where: A = Final Amount, P = Principal Amount, r = rate of interest,
33
// n = number of times interest is compounded per year and t = time (in years)
44

5-
pub fn compound_interest(princpal: f64, rate: f64, comp_per_year: u32, years: f64) -> f64 {
6-
let amount = princpal * (1.00 + rate / comp_per_year as f64).powf(comp_per_year as f64 * years);
7-
return amount;
5+
pub fn compound_interest(principal: f64, rate: f64, comp_per_year: u32, years: f64) -> f64 {
6+
let amount =
7+
principal * (1.00 + rate / comp_per_year as f64).powf(comp_per_year as f64 * years);
8+
amount
89
}
910

1011
#[cfg(test)]

0 commit comments

Comments
 (0)