mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-08 07:09:28 +03:00
fix entry balance checking by rounding to 8 places, for now
This commit is contained in:
parent
06b376385b
commit
d91977fbe6
@ -25,8 +25,9 @@ showEntryDescription e = (showDate $ edate e) ++ " " ++ (showDescription $ edesc
|
|||||||
showDate d = printf "%-10s" d
|
showDate d = printf "%-10s" d
|
||||||
showDescription s = printf "%-20s" (elideRight 20 s)
|
showDescription s = printf "%-20s" (elideRight 20 s)
|
||||||
|
|
||||||
|
-- quick & dirty: checks entry's 0 balance only to 8 places
|
||||||
isEntryBalanced :: LedgerEntry -> Bool
|
isEntryBalanced :: LedgerEntry -> Bool
|
||||||
isEntryBalanced = (0==) . quantity . sumLedgerTransactions . etransactions
|
isEntryBalanced = ((0::Double)==) . read . printf "%0.8f" . quantity . sumLedgerTransactions . etransactions
|
||||||
|
|
||||||
autofillEntry :: LedgerEntry -> LedgerEntry
|
autofillEntry :: LedgerEntry -> LedgerEntry
|
||||||
autofillEntry e@(LedgerEntry _ _ _ _ _ ts) =
|
autofillEntry e@(LedgerEntry _ _ _ _ _ ts) =
|
||||||
|
Loading…
Reference in New Issue
Block a user