# Comparison

> Branch on how two values compare.

Source: https://docs.buildcord.dev/nodes/conditions/comparison/

`logic.condition` compares two values and takes one of two ways out.

## Settings

| Setting | What it does |
| --- | --- |
| Value | The left side, such as `{option.amount}`. |
| Is | The test. See the table below. |
| Compared to | The right side, such as `10`. Ignored for the tests with nothing on their right. |

| Test | Passes when |
| --- | --- |
| equals, doesn't equal | The two are the same, or not. Numbers compare as numbers, so `5` equals `5.0`. |
| is greater than, is at least, is less than, is at most | Both are numbers, and they compare that way. |
| contains, doesn't contain, starts with, ends with | The text does, ignoring capitals. |
| is empty, isn't empty | The value has nothing in it but spaces, or has something. |
| is a number | The value reads as a number. |
| matches the pattern | The value matches a regular expression, such as `^\d{4}$`. |
| is one of, isn't one of | The value is among a list, separated by commas or by lines, such as `red, green, blue` or `{var.allowed}`. |

## Ways out

| Way out | Taken when |
| --- | --- |
| `True` | The test passes. |
| `False` | It doesn't. |

## Notes

- Both sides accept [tokens](https://docs.buildcord.dev/concepts/values).
- The canvas shows the test as a sign, such as `{option.amount} ≥ 10`.
- To test more than one thing at once, use [Several conditions](https://docs.buildcord.dev/nodes/conditions/several-conditions). To go a different way for each of many values, use [Switch](https://docs.buildcord.dev/nodes/conditions/switch).

## Example

`{option.amount}` **is at least** `1` stops a command from taking a zero or negative amount.

## Related

- [Several conditions](https://docs.buildcord.dev/nodes/conditions/several-conditions)
- [Switch](https://docs.buildcord.dev/nodes/conditions/switch)
- [Work out an equation](https://docs.buildcord.dev/nodes/variables-and-data/work-out-equation)
