Skip to main content

Number.Sign

Returns 1 if the number is positive, -1 if it is negative, and 0 if it is zero.

Syntax

Number.Sign(
number as number
) as number

Remarks

Returns 1 for if number is a positive number, -1 if it is a negative number, and 0 if it is zero. If number is null, Number.Sign returns null.

Examples

Example #1

Determine the sign of 182.

Number.Sign(182)

Result:

1

Example #2

Determine the sign of -182.

Number.Sign(-182)

Result:

-1

Example #3

Determine the sign of 0.

Number.Sign(0)

Result:

0

Category

Number.Operations