Skip to content
Algo Trade Analytics Docs

math.round() - Pine Script Function

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.

math.round(number) → const int
NameTypeDescription
numberconst int/floatThe value to be rounded.

The value of number rounded to the nearest integer, or according to precision.

  • Note that for ‘na’ values function returns ‘na’.