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