Skip to content

Added apr_interest function to financial #6025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
float
  • Loading branch information
cclauss authored Jun 19, 2023
commit 8f26ba8c6e8acb2f5fc005f0e5423a136cf689d1
6 changes: 3 additions & 3 deletions financial/interest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def simple_interest(
principal: float, daily_interest_rate: float, days_between_payments: int
principal: float, daily_interest_rate: float, days_between_payments: float
) -> float:
"""
>>> simple_interest(18000.0, 0.06, 3)
Expand Down Expand Up @@ -42,7 +42,7 @@ def simple_interest(
def compound_interest(
principal: float,
nominal_annual_interest_rate_percentage: float,
number_of_compounding_periods: int,
number_of_compounding_periods: float,
) -> float:
"""
>>> compound_interest(10000.0, 0.05, 3)
Expand Down Expand Up @@ -110,7 +110,7 @@ def apr_interest(
raise ValueError("principal must be > 0")

return compound_interest(
principal, nominal_annual_percentage_rate / 365, number_of_years * 365.0
principal, nominal_annual_percentage_rate / 365, number_of_years * 365
)


Expand Down