If Number is in Range

ConditionMath

Check if a number is in a specified range.

  • Condition block: the blocks placed inside it only run when the condition is met.

Inputs

NumberRequired

Number to check.

Example: 5

MinimumRequired

Inclusive minimum value.

Example: 1

MaximumRequired

Inclusive maximum value.

Example: 10

If True

Blocks to run when the condition is true.

Holds blocks

If False

Blocks to run when the condition is false.

Holds blocks

Outputs

Result

Whether the number is within the range.

Example: true

Build a bot using blocks like If Number is in Range

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode. View as Markdown

ID: if_number_in_range
  • Condition block: write if if_number_in_range(Args{...}) { ... }, or use it as a "true"/"false" value. See conditions.

Inputs

FieldInventScript nameValue
Numbernumbere.g. "5"
Minimumminimume.g. "1"
Maximummaximume.g. "10"
If Trueif_trueblocks: func() { ... }
If Falseif_falseblocks: func() { ... }

Outputs

FieldInventScript nameValue
Resultresulte.g. "true"

Example InventScript

if if_number_in_range(Args{
	number:  5,
	minimum: 1,
	maximum: 10,
}) {
	send_text_message(Args{channel_id: trigger.channel_id, message_content: "Yes"})
}

More math blocks