-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
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
Added apr_interest function to financial #6025
Conversation
Hi, is there additional changes that need to be made to proceed with the pull request? Thanks! |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cclauss I think this is good to merge as long as it passes the current workflows
for more information, see https://pre-commit.ci
pre-commit is failing because of a mypy error in a different function in the same file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compound_interest
function call in apr_interest
is causing mypy
to fail because compound_interest
takes an int
for the number of compounding periods:
def compound_interest(
principal: float,
nominal_annual_interest_rate_percentage: float,
number_of_compounding_periods: int,
) -> float:
We should change the type hint for number_of_compounding_periods
from int
to float
.
* Added apr_interest function to financial * Update interest.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update financial/interest.py * float --------- Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Describe your change:
In almost every scenario financial institutions will give the APR for a loan or credit card. This function allows you to calculate the interest without having to calculate the effective interest rate from the APR.
Checklist:
Fixes: #{$ISSUE_NO}
.