Îõ³h$ 1É      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH Safe-Inferred 8ÑÔÙîµ,formatn+Wrapper for the various formatting options.defaultFormatNÀFormatN {fstyle = FSCommaPrec, sigFigs = Just 2, addLPad = True}formatnÃData type representing styles of formatting dependent on the numberformatn+Data type representing styles of formattingformatn 1000 1 0.001formatnÈThe parameter represents the exponent to format to with Nothing meaning: 1e3 1e1 1e-3formatn 1,000 1 0.001formatn  00 1.00 0.00formatn100,000% 100% 0.1%formatn$1,000 $1 $0.001formatnSign componentformatnéDecomposition of a Double into the components that are needed to determine significant figure formatting.Èeliding type changes, the relationship between a Double and a SigFig is:) x == sign * figures * 10^{exponent} formatnsignformatn+significant figures expressed as an Integerformatn'the power of 10 exponent given figures.formatnconvert from a Double to a toSigFig (Just 2) 1234;SigFig {sfSign = SigFigPos, sfFigures = 12, sfExponent = 2}¯\x -> let (SigFig s fs e) = toSigFig Nothing x in let x' = ((if (s==SigFigNeg) then (-1.0) else 1.0) * fromIntegral fs * 10.0**fromIntegral e) in (x==0 || abs (x/x'-1) < 1e-6)formatnconvert from a  to a Double"fromSigFig (SigFig SigFigPos 12 2)1200.0 formatnincrease significant figures!formatnexpt format for a SigFig"formatnexpt format for a SigFig#formatn3expt format for a SigFig, with an exponent override)exptSFWith (Just 1) (toSigFig (Just 1) 1)"0.1e1")exptSFWith (Just 0) (toSigFig (Just 1) 1)"1e0",exptSFWith (Just (-1)) (toSigFig (Just 1) 1)"10e-1"$formatncomma format for a SigFig%formatndecimal format for a SigFig&formatnpercent format for a SigFig'formatndollar format for a SigFig(formatn?Format to x decimal places with no significant figure rounding.fixed (Just 2) 100"100.00"fixed (Just 2) 0.001"0.00")formatnÄFormat in exponential style, maybe with significant figure rounding.expt Nothing 1245 "1.245e3"expt (Just 3) 1245"1.24e3"expt (Just 3) 0.1245 "1.24e-1"expt (Just 2) 0"0"çIf we wanted to have expt (Just 2) 0 == "0.0e0" then SigFig would need refactoring as it doesn't remember the desired significant figure number except through the Integer mantissa, which disappears if the number happens to be zero.*formatn9Format in exponential style, with the suggested exponent.exptWith (Just 2) Nothing 1245 "12.45e2"exptWith (Just 6) (Just 3) 1245 "0.00124e6"+formatnÂFormat in decimal style, and maybe round to n significant figures.decimal Nothing 1.2345e-2 "0.012345"decimal (Just 2) 0.012345"0.012"decimal (Just 2) 12345"12000",formatnFormat with US-style commascomma (Just 3) 1234567 "1,230,000"-formatnAdjust format to a percent.percent commaSF (Just 3) 0.1234"12.3%"!percent decimalSF (Just 1) 0.1234"10%".formatnAdjust format to dollar style.dollar commaSF (Just 3) 1234"$1,230"*dollar (fixedSF (Just 2)) (Just 2) 0.01234"$0.01"/formatnÌDecimalStyle between 0.001 and 1000000 and ExponentStyle outside this range.0formatnúCommaStyle above 1,000 but below a million, DecimalStyle between 0.001 and a million and ExponentStyle outside this range.1formatnÖCompute the majority FormatStyle so a list of numbers can all have the same formatting;Also equalises the exponent to majority for exponent style."commaPrecStyle <$> [0,5e6,1e7,2e7]Ñ[CommaStyle,ExponentStyle (Just 6),ExponentStyle (Just 7),ExponentStyle (Just 7)],majorityStyle commaPrecStyle [0,5e6,1e7,2e7]ExponentStyle (Just 7)2formatnÂformat a number according to a FormatStyle and significant figuresformat CommaStyle (Just 2) 1234"1,200"3formatn$format a SigFig according to a style,formatSF CommaStyle (toSigFig (Just 2) 1234)"1,200"*formatSF CommaStyle (SigFig SigFigPos 0 1)"0"-formatSF CommaStyle (SigFig SigFigPos 0 (-1))"0.0"4formatnÞFormat between 0.001 and 1000000 using decimal style and exponential style outside this range.prec (Just 2) 0.00234"0.0023"prec (Just 2) 0.000023"2.3e-5"prec (Just 2) 123"120"prec (Just 2) 123456"120000"prec (Just 2) 1234567"1.2e6"5formatnäFormat using comma separators for numbers above 1,000 but below 1 million, otherwise use prec style.commaPrec (Just 3) 1234"1,230"commaPrec (Just 3) 1234567"1.23e6"6formatn%Consistently format a list of numbers+formats True precStyle (Just 1) [0,0.5,1,2]["0.0","0.5","1.0","2.0"]:formats False precStyle (Just 1) $ ((-1)*) <$> [0,0.5,1,2]["0.0","-0.5","-1.0","-2.0"]Áformats True commaPrecStyle (Just 1) $ ((-1000)*) <$> [0,0.5,1,2]%[" 0"," -500","-1,000","-2,000"]?formats True commaPrecStyle (Just 1) $ ((1e6)*) <$> [0,0.5,1,2]1[" 0"," 500,000","1,000,000","2,000,000"]=formats True commaPrecStyle (Just 1) $ ((1e6)*) <$> [0.9,2,3]["0.9e6","2.0e6","3.0e6"]Àformats True commaPrecStyle (Just 1) $ ((1e-6)*) <$> [0,0.5,1,2]%["0.0e-6","0.5e-6","1.0e-6","2.0e-6"]Àformats True commaPrecStyle (Just 1) $ ((1e-3)*) <$> [0,0.5,1,2]%["0.0000","0.0005","0.0010","0.0020"]?@ABCDEFGHÉ$formatn-0.2.1-Gd5ORKTbwSA2p0kLvpcvyy Data.FormatNFormatNfstylesigFigsaddLPadFStyle FSDecimal FSExponentFSCommaFSFixed FSPercentFSDollarFSPrec FSCommaPrecFSNone FormatStyle DecimalStyle ExponentStyle CommaStyle FixedStyle PercentStyle DollarStyle SigFigSign SigFigNeg SigFigPosSigFigsfSign sfFigures sfExponenttoSigFig fromSigFig incSigFigfixedSFexptSF exptSFWithcommaSF decimalSF percentSFdollarSFfixedexptexptWithdecimalcommapercentdollar precStylecommaPrecStyle majorityStyleformatformatSFprec commaPrecformats distinguishdefaultFormatNformatNformatNs formatOrShow $fEqFormatN $fShowFormatN$fGenericFormatN $fShowFStyle $fEqFStyle $fOrdFStyle$fShowFormatStyle$fEqFormatStyle$fOrdFormatStyle $fEqSigFig $fShowSigFig$fEqSigFigSign$fShowSigFigSign