abs - Liquid Filter Reference - 0.11.2

Filter Name abs
Group Numbers
Version 0.11.2

Description

Returns the absolute value of a number.

Examples

When a negative number is provided:
{{ -17 | abs }}
17
When a positive number is provided:
{{ 4 | abs }}
4
When a string containing only a number is provided:
{{ "-19.86" | abs }}
19.86

Back to Filter List

Back to Liquid Reference for 0.11.2

 

 
Back to Documentation