• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 473
  • Last Modified:

convert decimal array to byte array

i want to convert decimal array to byte array.
for example: i want to reverse this code.

Dim buffer As Byte() = {5, 6, 7, 9, 122, 45}
Dim float As Decimal = BitConverter.ToInt64(buffer, 0)
1 Solution
Depends how its stored, but BitConverter.ToDouble may be your friend. That's assuming it's in IEE754 format. Where are you getting the data from in the first place?

sayethAuthor Commented:
i load the data from database into a byte array. convert it to decimal(BitConverter.ToInt64(byte(), 0))
use it in my program. i m trying save back to the database. i need to convert the decimal back to byte()
to save it

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now