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.
If the value is of type String, then it is converted to a number. |
|---|
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
Dim 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