class Liquid::Filters::Abs

Overview

Filter abs

Returns the absolute value of a number.

{{ -17 | abs }} => 17

{{ 4 | abs }} => 4

abs will also work on a string if the string only contains a number.

{{ "-19.86" | abs }} => 19.86

Extended Modules

Defined in:

liquid/filters.cr

Class Method Summary

Class Method Detail

def self.filter(data : Any, args : Array(Any) | Nil = nil) : Any #

[View source]