---
title: "switch · RUAL Documentation"
description: "Returns a number based of the given expression."
canonical: https://docs.rual.nl/block-types/number/number_switch
language: en
---

# switch

This block is part of the [`number`](https://docs.rual.nl/block-types/number) group and was last modified in core [`v12.0.4`](https://docs.rual.nl/core-versions/120004).

Returns a number based of the given expression.

- expression required `value` The expression to evaluate.

- default `number` The default statement to be executed.

- output `number` Returns the number matching the expression.

- match `condition` Returns true in case a match was found.

A typical wiring for [switch](https://docs.rual.nl/block-types/number/number_switch): the `number` out pin feeds [cast to value](https://docs.rual.nl/block-types/type%20casting/number_convert_to_value).

![Studio canvas example for the switch block: typical wiring for switch.](https://docs.rual.nl/canvas-examples/number_switch.png)

### Version history

Introduced in [`v12.0.4`](https://docs.rual.nl/core-versions/120004).
