Add abs filter docs

This commit is contained in:
Adam Hollett
2016-04-05 09:31:44 -04:00
parent e79e4bb615
commit 0bfab96fc0

37
filters/abs.md Normal file
View File

@@ -0,0 +1,37 @@
---
title: abs
---
Returns the absolute value of a number.
```liquid
{% raw %}
{{ -17 | abs }}
{% endraw %}
```
```text
17
```
```liquid
{% raw %}
{{ 4 | abs }}
{% endraw %}
```
```text
4
```
`abs` will work on a string if the string only contains a number.
```liquid
{% raw %}
{{ "-19.86" | abs }}
{% endraw %}
```
```text
19.86
```