Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article
Applies to: ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Converts the input to an integer value (signed 32-bit) number representation.
Note
When possible, use int literals instead.
toint(
value)
Learn more about syntax conventions.
Name | Type | Required | Description |
---|---|---|---|
value | scalar | ✔️ | The value to convert to an integer. |
If the conversion is successful, the result is an integer. Otherwise, the result is null
. If the input includes a decimal value, the result truncate to only the integer portion.
The examples in this section show how to use the syntax to help you get started.
The following example converts a string to an integer and checks if the converted value is equal to a specific integer.
print toint("123") == 123
|project Integer = print_0
Output
Integer |
---|
true |
The following example inputs a decimal value and returns a truncated integer.
print toint(2.3)
|project Integer = print_0
Output
Integer |
---|
2 |