Math / Reference
alerta.math.round
TradingView-compatible spelling: math.round, runs without warnings
Rounds to the nearest integer, or — with `precision` — to that many decimal places. `math.round(x, 2)` is how dashboards trim a figure before `str.tostring`.
alerta.math.round(x, precision?) → series floatParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
x | series float | Yes | — | Value to round. |
precision | series int | No | — | Decimal places to keep. Omitted = round to an integer. |
Returns
series floatExample
alerta.math.round
const r = round(1.5)r2 = math.round(close / 7, 2)plot(r2, { title: "two decimals" })Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.