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:
November 8, 2026
:
content: Remove categories from front matter (1cc1dd83a)
Improve this page