Files
liquid/filters/abs.md
Frank Taillandier 725335bbc1 Fix redirection
2018-09-21 18:26:34 +02:00

636 B

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

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 ```