SIGN

Description

SIGN returns the sign of a number as an integer: -1 if the number is negative, 0 if it is zero, and 1 if it is positive.

Syntax

SIGN(number)

Returns: -1, 0, or 1.

Example

SIGN(-15)

This returns -1.

SIGN(0)

This returns 0.

SIGN(99.9)

This returns 1.

Example in context

p is Person
SIGN(p.account_balance)

Returns -1 if the balance is negative, 0 if it is exactly zero, and 1 if it is positive. Useful for conditional logic without writing a full if/case expression.

Last updated

Was this helpful?