From da0ce231446535056bdaf474567e2870b61680e6 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 26 Mar 2014 17:25:59 -0700 Subject: [PATCH] don't let default commodity limit the max precision (fixes #169) --- hledger-lib/Hledger/Read/JournalReader.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index b6f74f91a..faab9cda3 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -677,8 +677,8 @@ nosymbolamount = do p <- priceamount defcs <- getCommodityAndStyle let (c,s) = case defcs of - Just (c',s') -> (c',s') - Nothing -> ("", amountstyle{asdecimalpoint=dec, asprecision=prec, asseparator=sep, asseparatorpositions=seppos}) + Just (defc,defs) -> (defc, defs{asprecision=max (asprecision defs) prec}) + Nothing -> ("", amountstyle{asdecimalpoint=dec, asprecision=prec, asseparator=sep, asseparatorpositions=seppos}) return $ Amount c q p s "no-symbol amount"