[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36
John Goerzen
jgoerzen at complete.org
Fri Apr 23 15:14:56 UTC 2010
The following commit has been merged in the master branch:
commit c44718aa199c4c3343ba576756d70ae76bacacaf
Author: John Goerzen <jgoerzen at complete.org>
Date: Wed Nov 29 01:42:04 2006 +0100
Small improvements in Quantify.hs
diff --git a/MissingH/Quantity.hs b/MissingH/Quantity.hs
index f9f360b..bdf4caa 100644
--- a/MissingH/Quantity.hs
+++ b/MissingH/Quantity.hs
@@ -141,6 +141,16 @@ in the list will be evaluated for the suffix. The same suffix and scale will
be used for the remaining items in the list. See 'renderNum' for more
examples.
+Also, unlike 'renderNum', the %f instead of %g printf format is used so that
+\"scientific\" notation is avoided in the output.
+
+Examples:
+
+> *MissingH.Quantity> renderNums binaryOpts 3 [1500000, 10240, 104857600]
+> ["1.431M","0.010M","100.000M"]
+> *MissingH.Quantity> renderNums binaryOpts 3 [1500, 10240, 104857600]
+> ["1.465K","10.000K","102400.000K"]
+
-}
renderNums :: (Ord a, Real a) =>
SizeOpts
@@ -150,6 +160,6 @@ renderNums :: (Ord a, Real a) =>
renderNums opts prec numbers =
map printit convnums
where printit num =
- (printf ("%." ++ show prec ++ "g") num) ++ [suffix]
+ (printf ("%." ++ show prec ++ "f") num) ++ [suffix]
(convnums, suffix) =
(quantifyNums opts numbers)::([Double], Char)
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list