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. |
tianyizheng02
left a comment
There was a problem hiding this comment.
@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 |
tianyizheng02
left a comment
There was a problem hiding this comment.
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.
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}.