summaryrefslogtreecommitdiffstats
path: root/ledger
diff options
context:
space:
mode:
Diffstat (limited to 'ledger')
-rwxr-xr-xledger/lib/balance9
1 files changed, 4 insertions, 5 deletions
diff --git a/ledger/lib/balance b/ledger/lib/balance
index 1e9e2db2..f75410c3 100755
--- a/ledger/lib/balance
+++ b/ledger/lib/balance
@@ -42,15 +42,14 @@ function display_accounts() {
max_balance_len = 0
for (name in accounts) {
for (u in accounts[name]) {
- s = accounts[name][u]
- sub(/\..*/, "", s)
- if (length(s) > max_balance_len) {
- max_balance_len = length(s)
+ n = length(int(accounts[name][u]))
+ if (n > max_balance_len) {
+ max_balance_len = n
}
}
}
if (scale > 0) {
- max_balance_len += 1 + scale
+ max_balance_len += length(".") + scale
}
for (name in accounts) {