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
Rate function added #17
Conversation
Merging with main master
@gyanesh-m sorry to bother you but I think something is wrong with the CI. Do let me know when things are fixed so that I can continue with the PR |
reducing_utils.go
Outdated
at the beginning (when = 1) or the end (when = 0) of each period | ||
curRate: the rate compounded once per period rate | ||
*/ | ||
func getRateRatio(pv, fv, pmt, curRate float64, nper int64, when paymentperiod.Type) float64 { |
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.
don't use float, use decimal. Check other functions in this file.
reducing_utils.go
Outdated
OpenDocument-formula-20090508.odt | ||
*/ | ||
|
||
func Rate(pv, fv, pmt float64, nper int64, when paymentperiod.Type, params ...float64) (float64, bool) { |
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.
same, replace float with decimal.
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.
oops sorry about that. But also glad to see this library now supports floating precession :)
@thsubaku9 The pipeline is fine. There are errors in golangci-lint check. Find them locally using |
Let me know if any more changes are required @gyanesh-m |
@thsubaku9 will review the changes over weekend. |
lets gooooooo @gyanesh-m |
Lets go ? @gyanesh-m |
Any updates here ? @krantideep95 @gyanesh-m @captn3m0 |
Hey @thsubaku9, I will review this over the coming weekend. |
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.
lgtm
@thsubaku9 Thank you for adding this to go-financial ! 💯 🎉 |
This PR adds the Rate calculation function to go-financial (using Newton Rapson for the root calculation)