mirror of
https://github.com/kemko/liquid.git
synced 2026-01-04 17:25:41 +03:00
636 B
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 ```