Add code labels for abs filter

This commit is contained in:
Adam Hollett
2016-04-11 08:57:20 -04:00
parent 424c97464a
commit 89e3728ec8
+6
View File
@@ -4,34 +4,40 @@ title: abs
Returns the absolute value of a number. Returns the absolute value of a number.
<p class="code-label">Input</p>
```liquid ```liquid
{% raw %} {% raw %}
{{ -17 | abs }} {{ -17 | abs }}
{% endraw %} {% endraw %}
``` ```
<p class="code-label">Output</p>
```text ```text
17 17
``` ```
<p class="code-label">Input</p>
```liquid ```liquid
{% raw %} {% raw %}
{{ 4 | abs }} {{ 4 | abs }}
{% endraw %} {% endraw %}
``` ```
<p class="code-label">Output</p>
```text ```text
4 4
``` ```
`abs` will also work on a string if the string only contains a number. `abs` will also work on a string if the string only contains a number.
<p class="code-label">Input</p>
```liquid ```liquid
{% raw %} {% raw %}
{{ "-19.86" | abs }} {{ "-19.86" | abs }}
{% endraw %} {% endraw %}
``` ```
<p class="code-label">Output</p>
```text ```text
19.86 19.86
``` ```