From 69d72e8c48109b7b8b24a0e461479b217abe7e21 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 25 May 2019 05:34:29 -0700 Subject: [PATCH] ;refactor amountValue --- hledger-lib/Hledger/Data/Amount.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hledger-lib/Hledger/Data/Amount.hs b/hledger-lib/Hledger/Data/Amount.hs index e6149020c..39f7e733e 100644 --- a/hledger-lib/Hledger/Data/Amount.hs +++ b/hledger-lib/Hledger/Data/Amount.hs @@ -458,8 +458,8 @@ canonicaliseAmount styles a@Amount{acommodity=c, astyle=s} = a{astyle=s'} -- If no default valuation commodity can be found, the amount is left -- unchanged. amountValue :: Prices -> Day -> Amount -> Amount -amountValue prices d a@Amount{acommodity=c} = - case priceLookup prices d c of +amountValue prices d a = + case priceLookup prices d (acommodity a) of Just v -> v{aquantity=aquantity v * aquantity a} Nothing -> a