Round - method of the Pm object

Returns number rounded to a specified number of decimal places or whole places.
Double Round(Double nValue, [Double nPrec])
nValue(Double) A number to be rounded off.
nPrec[optional] (Double) Positive number indicating precision (number of decimal places or whole places) to round the number to.
The default value is 1.
For example:
0.01 = rounding to hundreths
0.1 = rounding to tenths
0.5 = rounding to five tenths
1 = rounding to whole numbers
10 = rounding to tens
25 = rounding to the closest multiple of 25
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.

In the variable of the PmVar type, can be entered automatic rounding in the "Rounding" configurator.
JavaScriptVBScriptSelect and copy to clipboard

var pi = 3.141159;
var n1 = Pm.Round(pi);   // Returns 3
var n2 = Pm.Round(pi, 0.01);   // Returns 3.14

Pm9.00.08: Bugfix of invalid rounding for nPrec > 1.
Pm8.03.26: The nPrec parameter is optional
Pm8.02.01: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
- Pm
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Round
- Sin
- Tan
© MICROSYS, spol. s r.o.