Overview

The Number Block is used to output a constant number value or convert an input value into a number. It can also be configured to round the number to a specified number of decimal places.

Inputs

input
any

The value to be converted into a number. This input is only available if the “Use Value Input” setting is enabled. If the input cannot be converted to a number, the block will use the Value setting instead.

Outputs

value
number

The output number value. This can either be a constant value or a converted input value.

Editor Settings

value
number
default:0

The constant number value to be outputted. This value is used when either:

  • The “Use Value Input” setting is disabled
  • The “Use Value Input” setting is enabled but no input is connected
  • The “Use Value Input” setting is enabled but the input cannot be converted to a number
useValueInput
boolean

When enabled, shows an input port that accepts any value and attempts to convert it to a number.

round
boolean
default:false

When enabled, rounds the output number to the specified number of decimal places.

roundTo
number
default:0

The number of decimal places to round to when the “Round” setting is enabled.

Example: Output a constant number

  1. Add a Number Block to your flow.
  2. Set the Value to 123.456.
  3. Run the flow. The value output of the Number Block will be 123.456.

Example: Convert a string to a number

  1. Add a Text Block to your flow and set the text to "123.456".
  2. Add a Number Block and enable the Use Value Input setting.
  3. Connect the Text Block to the input of the Number Block.
  4. Run the flow. The value output of the Number Block will be 123.456.

Example: Round a number

  1. Add a Number Block to your flow.
  2. Set the Value to 123.456.
  3. Enable the Round setting and set Round To to 2.
  4. Run the flow. The value output of the Number Block will be 123.46.

Error Handling

The Number Block will not error under normal circumstances. If the input value cannot be converted to a number when “Use Value Input” is enabled, it will default to using the Value setting.

FAQ

See Also