razorpay/go-financial ? reverse-engineered prompt
Reverse engineered prompt
Build me a Go library for common financial calculations, like the ones in numpy financial. I want functions for future value, present value, payment amount, interest payment, principal payment, number of periods, rate, and net present value, all working with decimal values so the results are accurate for money.
It should also include a loan amortization helper that can generate a repayment schedule from a config with dates, frequency, loan amount, interest type, payment timing, and rounding options. Please make it easy to print the schedule as rows and also create a simple plot or HTML output from it, like the README shows.
Use the existing tests and examples as a guide, keep the API clean and Go native, and make sure the package works well for both loan and investment style calculations. If anything is unclear, look up the current docs online first and match the intended behavior as closely as you can.
Are you gonna build this?
make sure you review the code using coderabbit