Portability | portable |
---|---|
Stability | experimental |
Maintainer | andrewjkay@gmail.com |
Safe Haskell | Safe-Infered |
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
:: Int | Number of digits (including leading zeros) |
-> Integer | Value |
-> ByteString | Packed BCD |
Pack an Integer into a ByteString
:: 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
:: Word8 | Number of decimal places |
-> ByteString | Packed BCD |
-> Decimal | Value |
Unpack a Decimal from a ByteString