Round to Nearest Whole
Number
round()
Rounds values in a time series or paired data set to the nearest whole number.
The function rounds up the decimal portion of a number if equal to or greater than .5 and rounds down decimal values less than .5. For example:
| 10.5 | is rounded to 11. | |
| 10.499 | is rounded to 10. |
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: roundOff();
truncate();
setCurve().
Parameters: Takes no parameters
Example: roundedData = dataSet.round()
Returns: A new HecMath object of the same type as the current object.