BCD Encoder & Decoder
Convert unsigned packed BCD to decimal and back, with 16-bit or 32-bit output.
How to use
Packed BCD stores one decimal digit per nibble. It is not ordinary HEX integer conversion; signed, date and vendor formats are not supported.
16 bits hold 4 decimal digits; 32 bits hold 8. Input is limited to 128 characters. Output is padded with zeroes.
1234 (DEC) ↔ 12 34 (BCD) · 32 bits: 00 00 12 34