We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d115f16 commit d29ce8cCopy full SHA for d29ce8c
1 file changed
src/financial/compound_interest.rs
@@ -2,9 +2,10 @@
2
// where: A = Final Amount, P = Principal Amount, r = rate of interest,
3
// n = number of times interest is compounded per year and t = time (in years)
4
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;
+pub fn compound_interest(principal: f64, rate: f64, comp_per_year: u32, years: f64) -> f64 {
+ let amount =
+ principal * (1.00 + rate / comp_per_year as f64).powf(comp_per_year as f64 * years);
8
+ amount
9
}
10
11
#[cfg(test)]
0 commit comments