From 0bfab96fc0b385583db26ab255886ef2b4259c55 Mon Sep 17 00:00:00 2001 From: Adam Hollett Date: Tue, 5 Apr 2016 09:31:44 -0400 Subject: [PATCH 1/2] Add abs filter docs --- filters/abs.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 filters/abs.md diff --git a/filters/abs.md b/filters/abs.md new file mode 100644 index 0000000..af0d003 --- /dev/null +++ b/filters/abs.md @@ -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 +``` From 6c3fc60e329eabf89ee976a400e3f0c63bdc20ab Mon Sep 17 00:00:00 2001 From: Adam Hollett Date: Tue, 5 Apr 2016 09:36:56 -0400 Subject: [PATCH 2/2] Add "also" --- filters/abs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filters/abs.md b/filters/abs.md index af0d003..c151423 100644 --- a/filters/abs.md +++ b/filters/abs.md @@ -24,7 +24,7 @@ Returns the absolute value of a number. 4 ``` -`abs` will 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. ```liquid {% raw %}