mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
558 B
558 B
title, description, redirect_from
| title | description | redirect_from |
|---|---|---|
| abs | Liquid filter that returns the absolute value of a number. | /filters/ |
Returns the absolute value of a number.
Input
```liquid {%- raw -%} {{ -17 | abs }} {{ 4 | abs }} {% endraw %} ```Output
```text {{ -17 | abs }} {{ 4 | abs }} ```abs will also work on a string that only contains a number.
Input
```liquid {%- raw -%} {{ "-19.86" | abs }} {% endraw %} ```Output
```text {{ "-19.86" | abs }} ```