# Math filters

Math filters apply mathematical operations.

Math filters apply mathematical operations.

Math filters can be chained and, like all filters, are applied from left to right. In this example `minus` is applied first, then `times`, then `divided_by`.

```liquid
You save {{ product.compare_at_price | minus: product.price | times: 100.0 | divided_by: product.compare_at_price }}%
```

## abs

Returns the absolute value of a number.

```liquid
{{ -17 | abs }}
```

```text
17
```

`abs` also works on a string that contains only a number.

```liquid
{{ "-19.86" | abs }}
```

```text
19.86
```

## at_most

Limits a number to a maximum value.

```liquid
{{ 4 | at_most: 5 }}
{{ 4 | at_most: 3 }}
```

```text
4
3
```

## at_least

Limits a number to a minimum value.

```liquid
{{ 4 | at_least: 5 }}
{{ 4 | at_least: 3 }}
```

```text
5
4
```

## ceil

Rounds an output up to the nearest integer.

```liquid
{{ 4.6 | ceil }}
{{ 4.3 | ceil }}
```

```text
5
5
```

## divided_by

Divides an output by a number. The output is rounded down to the nearest integer.

```liquid
{{ product.price | divided_by: 10 }}
```

```text
20
```

## floor

Rounds an output down to the nearest integer.

```liquid
{{ 4.6 | floor }}
{{ 4.3 | floor }}
```

```text
4
4
```

## minus

Subtracts a number from an output.

```liquid
{{ product.price | minus: 15 }}
```

```text
185
```

## plus

Adds a number to an output.

```liquid
{{ product.price | plus: 15 }}
```

```text
215
```

## round

Rounds the output to the nearest integer or to the given number of decimal places.

```liquid
{{ 4.6 | round }}
{{ 4.3 | round }}
{{ 4.5612 | round: 2 }}
```

```text
5
4
4.56
```

## times

Multiplies an output by a number.

```liquid
{{ product.price | times: 1.15 }}
```

```text
230
```

## modulo

Divides an output by a number and returns the remainder.

```liquid
{{ 12 | modulo:5 }}
```

```text
2
```
