accept --cpi=FILE --cpiy=YEAR to translate money to target year
All checks were successful
cicd / ci (push) Successful in 1m30s

This commit is contained in:
Bel LaPointe
2025-05-07 09:55:16 -06:00
parent 0d91cd63db
commit 2f8dba4e23
5 changed files with 48 additions and 11 deletions

View File

@@ -135,7 +135,7 @@ func (router Router) APITransactions(w http.ResponseWriter, r *http.Request) {
v := normalized[k]
if v := math.Abs(v["$"]); v < biggest {
normalizedDelta := biggest - v
normalizedFactor := normalizer.NormalizeFactor(ledger.Delta{Name: k, Date: time.Now().Format("2006-01-02")})
normalizedFactor := normalizer.NormalizeFactor(k, time.Now().Format("2006-01-02"))
normalized[fmt.Sprintf(`(%s trailing $)`, k)] = ledger.Balance{"$": normalizedDelta * normalizedFactor}
}
}