compare.Gt
Reports whether the first argument is greater than all of the subsequent arguments.
- Syntax
- compare.Gt ARG1 ARG2 [ARG...]
- Returns
- bool
- Alias
- gt
Usage
The compare.Gt function reports whether the first argument is greater than all of the subsequent arguments. Numbers are compared by value, regardless of type. You can also use this function to compare strings, boolean values, dates, and other comparable data types.
Examples
{{ compare.Gt 1 1 }} → false
{{ compare.Gt 1 2 }} → false
{{ compare.Gt 2 1 }} → true
{{ compare.Gt 1 1 1 }} → false
{{ compare.Gt 1 1 2 }} → false
{{ compare.Gt 1 2 1 }} → false
{{ compare.Gt 1 2 2 }} → false
{{ compare.Gt 2 1 1 }} → true
{{ compare.Gt 2 1 2 }} → false
{{ compare.Gt 2 2 1 }} → falseComparing numbers of different types:
{{ compare.Gt 1 1.0 }} → falseComparing other data types:
{{ compare.Gt "ab" "a" }} → true
{{ compare.Gt time.Now (time.AsTime "1964-12-30") }} → true
{{ compare.Gt true false }} → trueLast updated:
October 10, 2026
:
theme: Migrate aliases to a redirects data file (b732eba6c)
Improve this page