readme-lhs-0.7.0: See readme.md

Safe HaskellNone
LanguageHaskell2010

Readme.Format

Description

formatting of numbers and statistics

Synopsis

Documentation

average :: Foldable f => f Double -> Double Source #

average

>>> average [0..1000]
500.0

deciles :: Foldable f => Int -> f Double -> [Double] Source #

compute deciles

>>> deciles 5 [1..1000]
[1.0,200.5,400.5,600.5000000000001,800.5,1000.0]

percentile :: Foldable f => Double -> f Double -> Double Source #

compute a percentile

>>> percentile 0.1 [1..1000]
100.5

fixed :: Int -> Double -> Text Source #

fixed >>> fixed 2 22.256 "22.26"

commas :: Int -> Double -> Text Source #

format with 1000 separated commas, and a fixed decimal part >>> commas 2 123456.789 "123,456.79"

prec :: Int -> Double -> Text Source #

format a Float as a Scientific with a precision >>> prec 3 123456 "1.235e5"

secs :: Int -> Double -> Text Source #

format as seconds >>> secs 2 0.0000002345 "234ns"