Round - method of the Pm object
Description:
Returns number rounded to a specified number of decimal places or whole places.
Syntax:
Double Round(Double nValue, [Double nPrec])
Parameters:
nValue | (Double) A number to be rounded off. |
nPrec | [optional] (Double) Positive number specifies 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 |
---|
Example:
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
Dim pi, n1, n2
pi = 3.141159
n1 = Pm.Round(pi)
' Returns 3
n2 = Pm.Round(pi, 0.01)
' Returns 3.14