Skip to content

ToInt

Name Mandatory Description Default Type
⬅️ Input Takes input values of type Int, Float, String, or a collection of Ints and Floats. Note that the shard can only convert strings that represent numerical values, such as "5", and not words like "Five". Any
Output ➡️ Outputs a numerical whole number without any fractional or decimal component. Any

Converts various input types to type Int.

Details

This shard typecasts float and string numeric values into the single integer data type (int).

Examples

1
2
3
4
5
6
7
8
1 | ToInt | Log
Assert.Is(1 Break: true)

2.2 | ToInt | Log
Assert.Is(2 Break: true)

"3" | ToInt | Log
Assert.Is(3 Break: true)

[info] [sample-wire] 1
[info] [sample-wire] 2
[info] [sample-wire] 3