From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Global Method

Abs(v As Double) As Double

Supported for all project types and targets.

Returns the absolute value of a number.


result = Abs(value)

Part Type Description
result Double The absolute value of value.
value Double The number to convert to an absolute value.


The Abs function returns the positive equivalent of the value specified.

Sample Code

These examples use the Abs function to return the absolute values of the numbers specified.

Var d As Double
d = Abs(23.9) // returns 23.9
d = Abs(-23.9) // returns 23.9

See Also

Sign function