| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | andrewjkay@gmail.com |
| Safe Haskell | Safe-Infered |
Data.BCD.Packed
Description
A module containing packed binary-coded decimal (BCD) serialization functions
- bytesRequired :: Int -> Int
- packInteger :: Int -> Integer -> ByteString
- unpackInteger :: ByteString -> Integer
- packDecimal :: Int -> Word8 -> Decimal -> ByteString
- unpackDecimal :: Word8 -> ByteString -> Decimal
Documentation
Calculate the bytes required to store a number of digits
Arguments
| :: Int | Number of digits (including leading zeros) |
| -> Integer | Value |
| -> ByteString | Packed BCD |
Pack an Integer into a ByteString
Arguments
| :: ByteString | Packed BCD |
| -> Integer | Value |
Unpack an Integer from a ByteString
Arguments
| :: Int | Number of digits (including leading zeros and decimal places) |
| -> Word8 | Number of decimal places |
| -> Decimal | Value |
| -> ByteString | Packed BCD |
Pack a Decimal into a ByteString
Arguments
| :: Word8 | Number of decimal places |
| -> ByteString | Packed BCD |
| -> Decimal | Value |
Unpack a Decimal from a ByteString