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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top