to-float

The to-float operation turns a value into a decimal number.

Use it when the other side expects a number and you are holding text. Form fields arrive as strings, so 1.25 typed into a form is the four characters 1.25, not the number. Some APIs do not care, others reject the request.

It changes the type, not just the look of the value. The field stops being a string and becomes a float, so a JSON request carries 1.25 rather than "1.25", without quotation marks.

What comes out

  • An integer becomes its decimal equivalent. 42 becomes 42.0.
  • A numeric string becomes the number it represents. "1.25" becomes 1.25.
  • A string that starts with digits is read up to the first character that does not belong to a number. "123abc" becomes 123.0. Nothing warns you that the rest was dropped.
  • A string that does not start with a digit becomes 0.0. That covers "abc123", "N/A" and anything else that is not a number.
  • A boolean becomes 1.0 for true and 0.0 for false.
  • Null becomes 0.0. An empty field turns into a zero.
  • A list or an object cannot be converted and causes an error.

The catch

Everything that is not a number becomes zero, silently.

That matters when the value carries meaning. 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 out for the decimal comma as well. A form filled in as 1,25 is read only up to the comma, so it arrives as 1.0. If your fields can contain commas, clean them up with regex-replace before converting.

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.

Float or integer

Use to-float for anything with a decimal part: amounts, rates, percentages. Use to-int for counts and whole numbers, and be aware it cuts the decimals off rather than rounding.

If the advertiser works in whole units, to-int is usually what you want. If they expect 1200.00, to-float is.

Settings

The operation takes no parameter. Set the source and the condition, choose to-float, and there is nothing else to fill in.

Reference

The conversion follows PHP’s rules for casting to float. See PHP: Type Casting to Float.

Insights that
helps you grow

  • Release notes 2026/08/14
    This was a big one. We went through roughly 200 pages of our knowledge base and rewrote the whole thing. Clearer structure, consistent terminology, and…
  • Release notes 2026/07/31
    What’s new in PalDock? A lot of this month went into things you won’t see directly – query optimisation, indexing, and general tuning under the…
  • Free Affiliate tracking software
    Many companies (inlcuding YOU) search for free affiliate tracking software because they want to launch an affiliate program without committing to expensive monthly fees. The…