You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx

23 lines
476 B

---
page_title: abs - Functions - Configuration Language
sidebar_title: abs
description: The abs function returns the absolute value of the given number.
---
# `abs` Function
`abs` returns the absolute value of the given number. In other words, if the
number is zero or positive then it is returned as-is, but if it is negative
then it is multiplied by -1 to make it positive before returning it.
## Examples
```shell-session
> abs(23)
23
> abs(0)
0
> abs(-12.4)
12.4
```