Equinox Online Help - Language Reference - A to Z
Sign |
|
---|---|
Applies to | |
Syntax | Sign(NumberExpression) |
Action | [Function] Returns the sign of a number. |
Scope | Usable anywhere. |
Notes | This function returns 1 if NumberExpression is positive, 0 if it is zero, or -1 if it is negative |
Category | Maths |
See Also | Abs, Acos, Asin, Atan, Cos, Deg, Int, Log, Max, Min, MinMax, Rad, Rnd, RndStart, Round, Sin, Sqrt, Tan |
Example | This example method determines how to display an account balance field on a form. If the account balance is negative, a red warning message is displayed; if the account has a zero balance, no text is displayed; if the account is in credit, a green message appears. Switch Sign(AccountBalance)case -1end switchSet text, "attention", "OVERDRAWN"case 0 |