From 01758f99b915f34fe7ca4621e4d1ee09efe385b1 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Thu, 27 May 2021 08:34:49 -0700 Subject: Add math.Max and math.Min Closes #8583 --- docs/content/en/functions/math.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/content/en/functions/math.md b/docs/content/en/functions/math.md index 58cc5d5db..99b8cf34f 100644 --- a/docs/content/en/functions/math.md +++ b/docs/content/en/functions/math.md @@ -1,6 +1,6 @@ --- title: Math -description: Hugo provides nine mathematical operators in templates. +description: Hugo provides mathematical operators in templates. godocref: date: 2017-02-01 publishdate: 2017-02-01 @@ -35,7 +35,9 @@ aliases: [] | `modBool` | Boolean of modulus of two integers. Evaluates to `true` if result equals 0. | `{{modBool 15 3}}` → `true` | | `math.Ceil` | Returns the least integer value greater than or equal to the given number. | `{{math.Ceil 2.1}}` → `3` | | `math.Floor` | Returns the greatest integer value less than or equal to the given number. | `{{math.Floor 1.9}}` → `1` | -| `math.Round` | Returns the nearest integer, rounding half away from zero. | `{{math.Round 1.5}}` → `2` | | `math.Log` | Returns the natural logarithm of the given number. | `{{math.Log 42}}` → `3.737` | -| `math.Sqrt` | Returns the square root of the given number. | `{{math.Sqrt 81}}` → `9` | +| `math.Max` | Returns the greater of two numbers. | `{{math.Max 1 2}}` → `2` | +| `math.Min` | Returns the smaller of two numbers. | `{{math.Min 1 2}}` → `1` | | `math.Pow` | Returns the first number raised to the power of the second number. | `{{math.Pow 2 3}}` → `8` | +| `math.Round` | Returns the nearest integer, rounding half away from zero. | `{{math.Round 1.5}}` → `2` | +| `math.Sqrt` | Returns the square root of the given number. | `{{math.Sqrt 81}}` → `9` | -- cgit v1.2.3