mirror of
https://github.com/kemko/liquid.git
synced 2026-01-05 17:55:40 +03:00
611 B
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 ```