Created
June 5, 2009 07:17
-
-
Save simonmichael/124122 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95-- | Get the string representation of an amount, based on its commodity's | |
96-- display settings. | |
97showAmount ∷ Amount → String | |
98--showAmount a@(Amount (Commodity {symbol=sym,side=side,spaced=spaced}) _ pri) | |
99showAmount a@(Amount (Commodity sym side spaced _ _) _ pri) | |
100 | sym=="AUTO" = "" -- can display one of these in an error message | |
101 | side==L = printf "%s%s%s%s" sym space quantity price | |
102 | side==R = printf "%s%s%s%s" quantity space sym price | |
103 where | |
104 space = if spaced then " " else "" | |
105 quantity = showAmount' a | |
106 price = case pri of (Just pamt) → " @ " ++ showMixedAmount pamt | |
107 Nothing → "" | |
Ledger/Amount.hs:99:0: | |
Warning: Pattern match(es) are non-exhaustive | |
In the definition of `showAmount': | |
Patterns not matched: Amount (Commodity _ _ _ _ _) _ _ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment