18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong> <strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong><br />

Fix<br />

Description Returns the integer portion of a number<br />

Usage intVal = Fix(number)<br />

Arguments number<br />

The number argument can be any valid numeric expression.<br />

Return An integer value<br />

Remarks If number contains Null, Null is returned. Fix is internationally aware, meaning the return value is<br />

based on the Locale setting on the PC. The data type will be determined from the size of the<br />

Integer part. Possible return data types are Integer, Long, Double. Both Int and Fix remove the<br />

fractional part of number and return the resulting integer value.<br />

The difference between Int and Fix is that if number is negative, Int returns the first negative<br />

integer less than or equal to number, whereas Fix returns the first negative integer greater than<br />

or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8. Fix(number)<br />

is equivalent to: Sgn(number) * Int(Abs(number)).<br />

See also Int, Round, CInt, CLng<br />

Example MyNumber = Int(99.8) ' Returns 99.<br />

MyNumber = Fix(99.2) ' Returns 99.<br />

MyNumber = Int(-99.8) ' Returns -100.<br />

MyNumber = Fix(-99.8) ' Returns -99.<br />

MyNumber = Int(-99.2) ' Returns -100.<br />

MyNumber = Fix(-99.2) ' Returns -99.<br />

<strong>InduSoft</strong>, Ltd. 131

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!