Bcdenc()

Bcdenc() converts a 16 Bit Integer value into a packed 16 Bit BCD valu (4 Decimals) resp. an 8 Bit Integer value into an 8 Bit BCD value (2 Decimals).

Syntax: byte = Bcdenc( a as word )

Example:

  dim a as byte
  dim b as word
  a=Bcdenc(23)
  b=Bcdenc(2342)
  a = BcdDec(a)
  b = BcdDec(b)

See also: BcdDec(), BCD Value Construct