Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

Sgn

  • Last UpdatedJul 18, 2023
  • 1 minute read

Indicates the sign of a number. Sgn does not round the number, and ignores the fractional value of the number.

Sgn expects the argument (Num) to be a valid numeric value. If Num is greater than zero, Sgn returns the value of 1. If Num is equal to zero, Sgn returns the value of 0. If Num is less than zero, Sgn returns the value of -1.

Syntax

Sgn(Num)

Num:

An Integer or expression representing a valid numeric value.

Return Value

Returns a value indicating the Sign (+ or - ) value of the (Num) provided in the argument.

Abs | Fix | Int | Sqrt

Example

Dim vntVal
vntVal = Sgn(99.8) ' returns 1
vntVal = Sgn(-99.8) ' returns -1
vntVal = Sgn(0) ' returns 0

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in