Round Off to Specified
Precision
roundOff(integer significantDigits, integer powerOfTensPlace)
Round values in a time series or paired data set to a specified number of significant digits and/or power of tens place. For the power of tens place, -1 specifies rounding to one-tenth (0.1), while +2 rounds to the hundreds (100). For example:
1234.123456 will round to:
1230.0 for number of significant digits = 3, power of tens
place = -1
1234.1 for number of significant digits = 6, power of tens place
= -1
1234 for number of significant digits = 6,
power of tens place = 0
1230 for number of significant digits = 6,
power of tens place = 1
The x-values in paired data sets are unaffected by the function, only the y-value data
are rounded. For time series data sets, missing values are kept missing.
For paired data sets, use the setCurve() method to first select the paired data
curve(s).
See also: round();
truncate();
setCurve().
Parameters:
significantDigits – An integer specifying the number of significant digits
to use in the rounding.
powerOfTensPlace – An integer specifying the power of tens place to use in
the rounding.
Example: roundedData = dataSet.roundOff(5, -2)
Returns: A new HecMath object of the same type as the current object.