Conversion Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

So the plan is to send and recieve numbers of type double through the serial
port. I just don't know how to convert a double to a byte array as that's how
I am sending and recieving data through the port. Also, when recieving, how
to convert a byte array back to a double. Any information would be
appreciated. Thanks.

JRB
 
hi
you can use the BitConverter class
byte[] BitConverter.GetBytes( double )
the reverse is also there in the class

regards
Ansil
Dimensions
Technopark Trivandrum
(e-mail address removed)
 

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