business logic out of main
This commit is contained in:
@@ -55,9 +55,7 @@ func main() {
|
||||
for k, v := range deltas.Balances() {
|
||||
results := []string{}
|
||||
for subk, subv := range v {
|
||||
if int(subv) != 0 {
|
||||
results = append(results, fmt.Sprintf("%s %.2f", subk, subv))
|
||||
}
|
||||
results = append(results, fmt.Sprintf("%s %.2f", subk, subv))
|
||||
}
|
||||
if len(results) > 0 {
|
||||
fmt.Printf("%s\t%s\n", k, strings.Join(results, " + "))
|
||||
|
||||
Reference in New Issue
Block a user