'Declaration Public Function GetBytes() As Byte()
public byte[] GetBytes()
public: array<byte>^ GetBytes();
Return Value
An array of bytes is returned that is the binary representation of the value of this TdDecimal.
'Declaration Public Function GetBytes() As Byte()
public byte[] GetBytes()
public: array<byte>^ GetBytes();
Exception | Description |
---|---|
TdException | The value of the TdDecimal is Null. |
// The M indicates that the literal is a System.Decimal. TdDecimal original = new TdDecimal(983726465.23235M); Byte[] result = original.GetBytes(); //The scaled integer representation of 983726465.23235 is 98372646523235 //The hex representation of 98372646523235 is 0x59782AA6D163 // //result = {0x63, 0xD1, 0xA6, 0x2A, 0x78, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // This following example shows how a negative number will be represented. Internally, // negative numbers are stored in Two's Complement representation. original = TdDecimal.Parse("-4321.91"); result = original.GetBytes(); // The scaled integer representation of -4321.91 is -432191. // The Two's Complement of represenation of -42191 in hex is 0xFFF967C1. // // result = {0xC1, 0x67, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019