Abs

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.

 

Examples

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.


 
Copyright © 1999-2025 windevcluster.com
Some rights reserved