This commit is contained in:
bel
2023-10-27 08:30:25 -06:00
parent f0d9e3f666
commit dfce352f9f
2 changed files with 21 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
package ana
import (
"log"
"maps"
"math"
"regexp"
@@ -43,6 +44,11 @@ func NewContributionPredictor(reg ledger.Register) Predictor {
}
func newContributionPredictor(monthlyRate map[string]ledger.Balance) Predictor {
for name, balance := range monthlyRate {
for curr, v := range balance {
log.Printf("%s/%s gains %.2f per month", name, curr, v)
}
}
return func(given ledger.Balances, delta time.Duration) ledger.Balances {
month := time.Hour * 24 * 365 / 12
months := float64(delta) / float64(month)