Promotic

Round - function of language VBScript

Description:
Returns a number rounded to a specified number of decimal places.
In the PROMOTIC system it is better to use the Pm.Round method.
Syntax:
Double Round(Double expression, [Integer numdecimalplaces])
Parameters:
expression(Double) Numeric expression being rounded
numdecimalplaces[optional] (Integer) Number indicating how many places to the right of the decimal are included in the rounding.
If not set, then integers are returned.
Note:
Be careful on rounding the number 5. The function doesn't round this number always up but on the statistical basis (i.e. that after rounding many numbers, we would get the most accurate result). The function solves this problem so that odd numbers (e.g. 1.15) are rounded up (to 1.2), while even numbers (e.g. 1.25) are rounded down (to 1.2).
Example:
VBScriptSelect and copy to clipboard

Dim pi, nVar
pi = 3.14159
nVar = Round(pi, 2)   ' nVar contains 3.14
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

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