Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Trunc - method of object Pm

Description:
Returns the integer part of a number (remove any fractional digits).
Syntax:
Trunc(nValue As Double) As Integer
Calling:
n = Pm.Trunc(nValue)
Parameters:
nValue(Double) A number.
Note:
The method can also be called in the graphic item events for Web panels.

The method is functional also in Macro expression $.expr and in the onDraw event of the PmiCanvas graphic item.

 
This method works the same way as Pm.Floor for positive numbers and Pm.Ceil for negative numbers.
Example:
JavaScriptVBScriptSelect and copy to clipboard

var n;
n = Pm.Trunc(3.14);  //Returns 3
n = Pm.Trunc(-3.14);  //Returns -3
n = Pm.Trunc(0.04);  //Returns 0
n = Pm.Trunc(-0.04);  //Returns 0
n = Pm.Trunc(7);  //Returns 7
n = Pm.Trunc(-7);  //Returns -7
PROMOTIC 9.0.0 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- Tan
- Trunc
 
 
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice