Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Trunc - method of the Pm object

Description:
Returns the integer part of a number (removes any fractional digits).
Syntax:
Double Trunc(Double nValue)
Parameters:
nValue(Double) A number.
Note:
This method is functional also in Macro expression $.expr and in the onDraw event of the PmgCanvas object.
This method is also functional in Web panels.

This method works the same way as the Pm.Floor method for positive numbers and as the Pm.Ceil method 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

History:
Pm8.03.26: Created
PROMOTIC 9.0.17 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