From c827cbcc3e6acd93b4dd45f76b69a45a95853a55 Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Thu, 20 May 2021 09:28:10 +1000 Subject: [PATCH] lib: Refactor to eliminate use of printf. --- hledger-lib/Hledger/Data/Types.hs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/hledger-lib/Hledger/Data/Types.hs b/hledger-lib/Hledger/Data/Types.hs index 1d0bfce94..c15d04cda 100644 --- a/hledger-lib/Hledger/Data/Types.hs +++ b/hledger-lib/Hledger/Data/Types.hs @@ -49,7 +49,6 @@ import Data.Time.Calendar import Data.Time.LocalTime import Data.Word (Word8) import System.Time (ClockTime(..)) -import Text.Printf import Hledger.Utils.Regex @@ -196,13 +195,15 @@ data AmountStyle = AmountStyle { } deriving (Eq,Ord,Read,Generic) instance Show AmountStyle where - show AmountStyle{..} = - printf "AmountStylePP \"%s %s %s %s %s..\"" - (show ascommodityside) - (show ascommodityspaced) - (show asprecision) - (show asdecimalpoint) - (show asdigitgroups) + show AmountStyle{..} = concat + [ "AmountStylePP \"" + , show ascommodityside + , show ascommodityspaced + , show asprecision + , show asdecimalpoint + , show asdigitgroups + , "..\"" + ] -- | The "display precision" for a hledger amount, by which we mean -- the number of decimal digits to display to the right of the decimal mark.