github.com/rstandt/terraform@v0.12.32-0.20230710220336-b1063613405c/website/docs/configuration/functions/abs.html.md (about) 1 --- 2 layout: "functions" 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 -> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and 12 earlier, see 13 [0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). 14 15 `abs` returns the absolute value of the given number. In other words, if the 16 number is zero or positive then it is returned as-is, but if it is negative 17 then it is multiplied by -1 to make it positive before returning it. 18 19 ## Examples 20 21 ``` 22 > abs(23) 23 23 24 > abs(0) 25 0 26 > abs(-12.4) 27 12.4 28 ```