github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/numeric/abs.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: abs - Functions - Configuration Language
     4  sidebar_title: abs
     5  description: The abs function returns the absolute value of the given number.
     6  ---
     7  
     8  # `abs` Function
     9  
    10  `abs` returns the absolute value of the given number. In other words, if the
    11  number is zero or positive then it is returned as-is, but if it is negative
    12  then it is multiplied by -1 to make it positive before returning it.
    13  
    14  ## Examples
    15  
    16  ```shell-session
    17  > abs(23)
    18  23
    19  > abs(0)
    20  0
    21  > abs(-12.4)
    22  12.4
    23  ```