mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-10-09 12:57:08 +00:00
20 lines
399 B
Plaintext
20 lines
399 B
Plaintext
|
# check1 - print total deposits and checks
|
||
|
|
||
|
/^check/ { ck = 1; next }
|
||
|
/^deposit/ { dep = 1; next }
|
||
|
/^amount/ { amt = $2; next }
|
||
|
/^$/ { addup() }
|
||
|
|
||
|
END { addup()
|
||
|
printf("deposits $%.2f, checks $%.2f\n",
|
||
|
deposits, checks)
|
||
|
}
|
||
|
|
||
|
function addup() {
|
||
|
if (ck)
|
||
|
checks += amt
|
||
|
else if (dep)
|
||
|
deposits += amt
|
||
|
ck = dep = amt = 0
|
||
|
}
|