Abs

Not available in this language yet.
Abs( value )
Abs( value )
Abs( value )
Not available in this language yet.
Abs( value )

Description

The Abs function is used to get the absolute value of a number.

Parameters

Argument Type Definition and Requirements

value

Number

Take the absolute value of this argument.

Returns

A number which is the absolute value of a numeric input argument.

Examples

The query below returns the absolute value of -100.

Not available in this language yet.
Not available in this language yet.
System.out.println(
    client.query(
        Abs(Value(-100))
    ).get());
100
client.query(
  q.Abs(-100)
)
.then((ret) => console.log(ret))
100
Not available in this language yet.
println(Await.result(
  client.query(
    Abs(-100)
  ),
  5.seconds
))
100

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!