byteunits-0.2.0.1: Human friendly conversion between byte units (KB, MB, GB...)
Data.ByteUnits
Synopsis
data ByteUnit Source #
Constructors
Instances
Methods
(==) :: ByteUnit -> ByteUnit -> Bool #
(/=) :: ByteUnit -> ByteUnit -> Bool #
showsPrec :: Int -> ByteUnit -> ShowS #
show :: ByteUnit -> String #
showList :: [ByteUnit] -> ShowS #
getUnits :: ByteUnit -> Float -> Float Source #
getAppropriateUnits :: Float -> (ByteUnit, Float) Source #
Rounds up to the highest unit provided it's > 1
>>> getAppropriateUnits 1024 (KiloBytes,1.0)
>>>
getAppropriateUnits 1024
>>> getAppropriateUnits (3.5 * 1024* 1024) (MegaBytes,3.5)
getAppropriateUnits (3.5 * 1024* 1024)