Open arobase-che opened 1 year ago
Hello \o
I got that error when I tried to make a credit simulation at the end of any month.
Can be reproduced with :
package main import ( "fmt" "time" financial "github.com/razorpay/go-financial" "github.com/razorpay/go-financial/enums/frequency" "github.com/razorpay/go-financial/enums/interesttype" "github.com/razorpay/go-financial/enums/paymentperiod" "github.com/shopspring/decimal" ) func main() { date := time.Date(2023, 5, 31, 12, 0, 0, 0, time.UTC) FinancingDurationInMonths := 12 config := financial.Config{ StartDate: date, EndDate: date.AddDate(0, FinancingDurationInMonths, 0).AddDate(0, 0, -1), Frequency: frequency.MONTHLY, AmountBorrowed: decimal.NewFromInt(35_000), InterestType: interesttype.FLAT, Interest: decimal.NewFromFloat(4.20), PaymentPeriod: paymentperiod.BEGINNING, } amortization, err := financial.NewAmortization(&config) if err != nil { fmt.Println(err.Error(), "failed to initialize amortization rules") } else { fmt.Println(amortization) } }
Is it expected or I'm doing something wrong ?
Hello \o
I got that error when I tried to make a credit simulation at the end of any month.
Can be reproduced with :
Is it expected or I'm doing something wrong ?