Example below assigns the variable positiveVal the absolute value of -42, which is 42:
positiveVal
-42
42
{% assign positiveVal = -42 | abs %}