logo


70.3.0 Numerical Functions


Numerical functions return a value that is a number. Here are the numerical functions that STATIC recognizes in the Formula Editor:

:

Numerical Functions

Function

Effect

Example

Int

Returns the integer part of a number; that is, the portion of the number that is on the left side of the decimal point.

Int(1.91) returns 1

Int(0.91) returns 0

Dec

Returns the decimal part of a number; that is, the portion of the number that is to the right of the decimal point.

Dec(1.91) returns.91

Dec(1.0) returns 0

Round

Returns the number rounded to the number of decimal places that you specify in the call to the Round function. This means that you have to pass two parameters to the Round function: the number to be rounded, and the number of decimal places that you want to get back in the result. When you pass parameters to a 4th Dimension function, you separate the parameters with semicolons. Let's take the number 518.567 and see what happens when we pass different parameters.

Round(518.567;0) returns the value 519

Round(518.567;1) returns the value 518.6

Round(518.567;2) returns the value 518.57

Round(518.567;3) returns the value 518.567

Round(518.567;-1) returns the value 510

Round(518.567;-2) would return the value 500

Trunc

Returns the number truncated (“chopped off”) to the number of decimal places that you specify in the call to the Trunc function. This means that you have to pass two parameters to the Trunc function: the number to be truncated, and the number of decimal places that you want to get back in the result. Let's take the number 518.567 and see what happens when we pass different parameters.

Trunc(518.567;0) returns the value 518

Trunc(518.567;1) returns the value 518.5

Trunc(518.567;-1) returns the value 510

Abs

Returns the absolute value of a number; that is, Abs returns the Positive value of the number.

Abs(518.567) returns the value 518.567

Abs(-518.567) returns the value 518.567

User Tip: Round and Trunc are very similar. The difference between the two is that Round actually rounds off the number before returning the result, and Trunc does not round off the number.



Harrowex Pty Ltd
http://www.hxmedical.com
Voice:+ 61 4 27 344 279
Fax: +61 3 52 439 019
static@hxmedical.com