Skip to main content

To Number

Runs on: Shared — pure logic, runs on the Streamerly backend or inside a chatbox overlay.

The To Number node parses an incoming value and attempts to convert it to a number. If the conversion succeeds, the numeric result flows out through the output handle and processing continues normally. If the value cannot be parsed as a valid number — for example, the text "hello" or an empty string — the flow branch stops silently rather than passing an invalid value downstream.

This built-in guard makes To Number safe to use after extracting user-supplied text. Viewers often type unexpected things, and this node ensures that only valid numeric input reaches math nodes, variable setters, or comparisons.

Inputs

NameTypeDescription
inputanyThe value to convert. Strings like "42" or "3.14" succeed; non-numeric strings stop the flow.

Outputs

NameTypeDescription
outputnumberThe parsed numeric value, only emitted when conversion succeeds.

Example

A Chat Command trigger for !setvolume extracts the argument from the message using a String Op node. Connect the extracted text to a To Number node. If the viewer typed a valid number like 75, it flows on to a Math Check to verify it is between 0 and 100, then to an OBS Set Volume effect. If they typed something invalid like !setvolume loud, the flow stops at To Number and nothing breaks.