Files
liquid/filters/abs.md
2016-11-08 16:23:33 -05:00

611 B

title, description
title description
abs Liquid filter that gets the absolute value of a number.

Returns the absolute value of a number.

Input

```liquid {% raw %} {{ -17 | abs }} {% endraw %} ```

Output

```text 17 ```

Input

```liquid {% raw %} {{ 4 | abs }} {% endraw %} ```

Output

```text 4 ```

abs will also work on a string if the string only contains a number.

Input

```liquid {% raw %} {{ "-19.86" | abs }} {% endraw %} ```

Output

```text 19.86 ```