math.Round
Returns the nearest integer, rounding half away from zero.
- Syntax
- math.Round VALUE
- Returns
- float64
Usage
The math.Round function returns the nearest integer, rounding half away from zero.
Examples
{{ math.Round 1.4 }} → 1
{{ math.Round 1.5 }} → 2
{{ math.Round 2.5 }} → 3With a negative number:
{{ math.Round -1.5 }} → -2Last updated:
October 21, 2026
:
content: Apply style guide to math functions (658ef2b60)
Improve this page