byteunits-0.3.0.2: Human friendly conversion between byte units (KB, MB, GB...)

Safe HaskellSafe
LanguageHaskell2010

Data.ByteUnits

Synopsis

Documentation

getBytes :: ByteValue -> Float Source #

Gets the value of bytes from a ByteValue type

convertByteUnit :: ByteValue -> ByteUnit -> ByteValue Source #

Converts the ByteValue to an ByteValue with the specified ByteUnit

getAppropriateUnits :: ByteValue -> ByteValue Source #

Converts to the largest unit size provided the float value is > 1

>>> getAppropriateUnits (ByteValue 1024 Bytes)
ByteValue 1 KiloBytes
>>> getAppropriateUnits (ByteValue (3.5 * 1024* 1024) Bytes)
ByteValue 3.5 MegaBytes