Function that returns the absolute value of a number (ignoring positive/negative sign).
Syntax
Abs (number)
The Abs function will always return a positive number.
Dim dblDemo
dblDemo = Abs (-123.4)
123.4
dblDemo = Abs (45.1)
45.1
PowerShell equivalent, assign the absolute value of -15 to the variable $a:
$a = [math]::abs(-15)
âI've nothing much to offer, Thereâs nothing much to take, Iâm an absolute beginnerâ ~ David Bowie
Related:
Int - Return the integer portion of a number.