github.com/hugorut/terraform@v1.1.3/website/docs/language/functions/abs.mdx (about) 1 --- 2 page_title: abs - Functions - Configuration Language 3 description: The abs function returns the absolute value of the given number. 4 --- 5 6 # `abs` Function 7 8 `abs` returns the absolute value of the given number. In other words, if the 9 number is zero or positive then it is returned as-is, but if it is negative 10 then it is multiplied by -1 to make it positive before returning it. 11 12 ## Examples 13 14 ``` 15 > abs(23) 16 23 17 > abs(0) 18 0 19 > abs(-12.4) 20 12.4 21 ```