math.round() - Pine Script Function
math.round()
Section titled “math.round()”Overview
Section titled “Overview”Returns the value of number rounded to the nearest integer, with ties rounding up. If the precision parameter is used, returns a float value rounded to that amount of decimal places.
Syntax
Section titled “Syntax”math.round(number) → const intParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| number | const int/float | The value to be rounded. |
Returns
Section titled “Returns”The value of number rounded to the nearest integer, or according to precision.
Remarks
Section titled “Remarks”- Note that for ‘na’ values function returns ‘na’.