lib: Refactor to eliminate use of printf.

This commit is contained in:
Stephen Morgan 2021-05-20 09:28:10 +10:00 committed by Simon Michael
parent e80bb37b1c
commit c827cbcc3e

View File

@ -49,7 +49,6 @@ import Data.Time.Calendar
import Data.Time.LocalTime import Data.Time.LocalTime
import Data.Word (Word8) import Data.Word (Word8)
import System.Time (ClockTime(..)) import System.Time (ClockTime(..))
import Text.Printf
import Hledger.Utils.Regex import Hledger.Utils.Regex
@ -196,13 +195,15 @@ data AmountStyle = AmountStyle {
} deriving (Eq,Ord,Read,Generic) } deriving (Eq,Ord,Read,Generic)
instance Show AmountStyle where instance Show AmountStyle where
show AmountStyle{..} = show AmountStyle{..} = concat
printf "AmountStylePP \"%s %s %s %s %s..\"" [ "AmountStylePP \""
(show ascommodityside) , show ascommodityside
(show ascommodityspaced) , show ascommodityspaced
(show asprecision) , show asprecision
(show asdecimalpoint) , show asdecimalpoint
(show asdigitgroups) , show asdigitgroups
, "..\""
]
-- | The "display precision" for a hledger amount, by which we mean -- | 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. -- the number of decimal digits to display to the right of the decimal mark.