Promotic

CLng - function of language VBScript

Description:
Returns an expression that has been converted to the value of the Long type.
In the PROMOTIC system it is better to use the Pm.Round method (or Pm.Trunc, Pm.ToNumber).
Syntax:
Long CLng(Variant expression)
Parameters:
expression(Variant) Any valid expression.
Note:
The conversion functions can be used e.g. if you want some operation result to be expressed as a particular data type (rather than the default data type). For example, use CInt or CLng to force integer arithmetic in cases where single-precision, or double-precision arithmetic normally would occur.
Use the CLng function to provide internationally aware conversion from any other data type to the value of the Long type. For example, different decimal separators are properly recognized depending on the locale setting of Windows system, as are different thousand separators.
Note: CLng function differs from the Int and Fix functions, which truncate, rather than round, the fractional part of a number. If the fractional part is exactly 0.5, then the CLng function always rounds it to the nearest even number. For example, 0.5 rounds to 0, and 1.5 rounds to 2.
Example:
VBScriptSelect and copy to clipboard

Dim n
n = CLng(25427.45)   ' Returns 25427
n = CLng(25427.55)   ' Returns 25428
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.