Fix - function of language VBScript

Returns the integer portion of a number.

In the PROMOTIC system it is better to use the Pm.Trunc method.

Integer Fix(Double number)
number(Double) Any valid numeric expression.

Both Int and Fix remove the fractional part of number and return the resulting integer value.

The difference between Int and Fix is that if number is negative, Int returns the first negative integer less or equal to number, whereas Fix returns the first negative integer greater or equal to number. For example, Int convert -8.4 to -9 and Fix to -8.

Fix(number) is equivalent to:

Sgn(number) * Int(Abs(number))

VBScriptSelect and copy to clipboard

Dim n
n = Fix(99.2)  'Returns 99
n = Fix(-99.8)  'Returns -99
n = Fix(-99.2)  'Returns -99
PROMOTIC 9.0.13 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice