views:

64

answers:

1

I have a single that might have a decimal place but might not.
I have to put the digit before the decimal into the first 4 bytes and the digit after in the next 4 bytes.
So 1.1 would be 01-00-00-00-01-00-00-00
or 2.1 would be 02-00-00-00-01-00-00-00
or 1 would be 01-00-00-00-00-00-00-00

The digit before the decimal point is stored like an integer in bytes the same with the digit after the point.
So 1.1 gets split into 1 and 1 and then stored as 2 DWORDS: 01000000 and 01000000

+1  A: 

Like this:

Dim b(7) As Byte
b(0) = Convert.ToByte(Math.Floor(n))
b(4) = Convert.ToByte((n - Math.Floor(n)) * 10)
Guffa