Skip to content

ToFloat

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 value that can include a fractional or decimal component. Any

Converts various input types to type Float.

Details

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

Examples

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

2.2 | ToFloat | Log
Assert.Is(2.2 Break: true)

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

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