BinaryFormat.SignedInteger32
BinaryA binary format that reads a 32-bit signed integer.
Syntax
BinaryFormat.SignedInteger32(binary as binary) as anyParameters
| Name | Type | Required | Description |
|---|---|---|---|
binary | binary | Yes | The binary data to read the 32-bit signed integer from. |
Return Value
function — A binary format function that reads a 4-byte signed integer from binary data.
Remarks
BinaryFormat.SignedInteger32 is a binary format specifier that reads a 32-bit (4-byte) signed integer from binary data. The value range is -2,147,483,648 to 2,147,483,647 (Int32 / int). The integer is stored in two's complement format.
The default byte order is little-endian. Use BinaryFormat.ByteOrder to wrap this format if the source data uses big-endian byte ordering.
This is the most commonly used signed integer format in binary files, corresponding to a standard 32-bit integer in most programming languages.
Examples
Example 1: Read a 32-bit signed integer
let
binaryData = #binary({0x01, 0x00, 0x00, 0x00}),
result = BinaryFormat.SignedInteger32(binaryData)
in
resultExample 2: Read a negative 32-bit signed integer
let
// -100 in 32-bit two's complement little-endian
binaryData = #binary({0x9C, 0xFF, 0xFF, 0xFF}),
result = BinaryFormat.SignedInteger32(binaryData)
in
resultCompatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks