Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Pretty printing utils.
Documentation
Pretty Float Source # | |
Pretty Int Source # | |
Pretty Integer Source # | |
Pretty String Source # | |
Pretty Doc Source # | |
Pretty UTCTime Source # | |
Pretty Bytes Source # | |
Pretty Seconds Source # | |
Pretty Sized Source # | |
Pretty Used Source # | |
Pretty Timed Source # | |
Pretty BuildError Source # | |
Pretty Platform Source # | |
Pretty Environment Source # | |
Pretty a => Pretty [a] Source # | |
Pretty a => Pretty (Range a) Source # | |
Pretty a => Pretty (Comparison a) Source # | |
pprEngDouble :: String -> Double -> Maybe Doc Source #
Pretty print an engineering value, to 4 significant figures. Valid range is 10^(-24) (y/yocto) to 10^(+24) (Y/Yotta). Out of range values yield Nothing.
examples:
liftM render $ pprEngDouble "J" 102400 ==> Just "1.024MJ" liftM render $ pprEngDouble "s" 0.0000123 ==> Just "12.30us"
pprEngInteger :: String -> Integer -> Maybe Doc Source #
Like pprEngDouble
but don't display fractional part when the value is < 1000.
Good for units where fractional values might not make sense (like bytes).