The to-int operation turns a value into a whole number.
Use it when the other side expects an integer and you are holding text, or when a value carries decimals that have no business being there.
It changes the type, not just the look of the value. A JSON request then carries 42 rather than "42", without quotation marks.
What comes out
- A numeric string becomes the number it represents.
"42"becomes42. - A string with decimals loses them.
"1.25"becomes1. - A float loses them too.
1.25becomes1and-3.9becomes-3. The decimals are cut off, not rounded, so2.9becomes2and never3. - A string that starts with digits is read up to the first character that does not belong to a number.
"123abc"becomes123. - A string that does not start with a digit becomes
0. That covers"abc","N/A"and anything else that is not a number. - A boolean becomes
1for true and0for false. - Null becomes
0. An empty field turns into a zero. - A list or an object cannot be converted and causes an error.
The catch
Two things bite here, and both are silent.
Decimals disappear rather than round. An amount of 1999.90 becomes 1999, and a rate of 0.95 becomes 0. If the value is money and the advertiser works in whole units, that is what you want. If it is a rate or a percentage, to-int destroys it, and to-float is the right operation.
Anything that is not a number becomes zero. An income field left empty, or filled in as “none”, reaches the advertiser as 0, which reads as “this person earns nothing” rather than “we do not know”. Some advertisers reject on that, others accept the lead and pay less for it.
Watch the decimal comma as well. A form filled in as 1,25 is read only up to the comma, so it arrives as 1. If your fields can contain commas, clean them up with regex-replace first.
So decide what an empty or invalid value should be before you convert it. Put a condition on the step so it only runs on values that look like numbers, or handle the empty case separately with set value or do-not-send.
Careful with codes
A number that is really an identifier should stay a string. Bank codes, product codes and postal codes often start with a zero, and to-int throws it away: 0100 becomes 100.
Use to-int for quantities and amounts, not for anything you would never do arithmetic with.
Settings
The operation takes no parameter. Set the source and the condition, choose to-int, and there is nothing else to fill in.
Reference
The conversion follows PHP’s rules for casting to integer. See PHP: Converting to integer.

