Binary Coded Decimal (BCD) how to convert???

  • Thread starter Thread starter Jochen Stuempfig
  • Start date Start date
J

Jochen Stuempfig

hello,

i have two int values which i have to write into an byte (using bcd
notation) and send it to
network resource.

my question is now, how can i convert the int value to bcd an store this
information in
an byte and also the other way?

greets jochen
 
Jochen said:
hello,

i have two int values which i have to write into an byte (using bcd
notation) and send it to
network resource.

my question is now, how can i convert the int value to bcd an store this
information in
an byte and also the other way?

greets jochen
public Byte toBCD(int ileft, int iright)
{
return Convert.ToByte(ileft*16+iright);
}

David Logan
 
Back
Top