# Liquid operators

If you've done any computer programming before, you'll be familiar with operators. In Liquid, operators let you make logical decisions and comparisons.&#x20;

For example, you might need to check if a particular number is bigger than another number, or check to see if something has been filled in.

{% hint style="info" %}
Mathematical operations are performed using [Liquid filters](/liquid-syntax/introduction/liquid-filters.md), rather than operators.
{% endhint %}

## Main operators

| Operator | Function                 |
| -------- | ------------------------ |
| `==`     | equals                   |
| `!=`     | does not equal           |
| `>`      | greater than             |
| `<`      | less than                |
| `>=`     | greater than or equal to |
| `<=`     | less than or equal to    |
| `or`     | logical or               |
| `and`    | logical and              |

For example, here we use less than to print a statement if an opportunity charge total is less than 100.

```markup
{% if order.charge_excluding_tax_total < 100 %}
  Spend some more money with us!
{% endif %}
```

## `contains`

Use `contains` to check for the presence of a substring in a string.

```
{% if customer.email contains "current-rms.com" %}
  You work for Current RMS, lucky you!
{% endif %}
```

It's especially useful for multi-select [custom fields](/liquid-syntax/information/custom-fields.md), where selected list options are stored as a comma-separated string.

{% hint style="info" %}
You can't use `contains` to check for an object in an array of objects. It only searches strings.
{% endhint %}

## Order of operations

In tags with more than one `and` or `or` operator, operators are checked in order from right to left.&#x20;

```markup
{% if true or false and false %}
  This evaluates to true, since the 'and' condition is checked first.
{% endif %}
```

```markup
{% if true and false and false or true %}
  This evaluates to false, since the tags are checked like this:

  true and (false and (false or true))
  true and (false and true)
  true and false
  false
{% endif %}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://current-rms.gitbook.io/liquid-syntax/introduction/operators.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
